Closed sergiotapia closed 10 years ago
I can access them all using the comment.attributes[:name]
notation. Odd, I wish there were some consistancy here.
The voting properties use the RedditKit::Votable module. Although the actual attributes returned by reddit are named ups
and downs
, those are hidden in favor of the dedicated accessor methods in RedditKit::Votable.
As for the error with name
, that's a similar situation; the full_name
instance method gives you back the full name, even those the actual attribute from reddit is simply name
.
The rationale behind it is that RedditKit should be a nice wrapper on top of reddit's API, hiding ugly or unclear attribute names behind simple accessors, while still providing access to the raw API data if needed.
I'll update the documentation tonight to better point this out; it's unclear from just reading the README, sorry about that!
Hopefully that helps!
I'm fetching the comments for a user:
And I'm getting
undefined method for 'name'
errors. And not only for name, also forups
anddowns
.Using the RubyMine debugger I can see these properties values, yet I can't access them in code or in the Watches window. Is this a known bug?