hayesdavis / grackle

Lightweight Ruby library for the Twitter API that goes with the flow.
228 stars 36 forks source link

Provide Better to_s on TwitterStruct That Includes id #3

Open hayesdavis opened 15 years ago

hayesdavis commented 15 years ago

Several people have noted that the id method that is often placed on TwitterStructs which represent Tweets, Users, etc is not printed in irb sessions. This has caused some confusion and made people think you can't access the id.

It's not printed in irb because id is normally a method on Object and so OpenStruct (which TwitterStruct extends) doesn't include it in its to_s.

Provide a custom to_s method on TwitterStruct that includes the id.