hayesdavis / grackle

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

Provide Hash Style Access To Attributes #4

Open hayesdavis opened 15 years ago

hayesdavis commented 15 years ago

TwitterStructs returned by requests have methods for each attribute returned. It would also be nice to be able to reference these attributes using strings in a hash-style syntax like

res = client.users.show? :screen_name=>'hayesdavis'
res['screen_name'] #returns hayesdavis

This would be especially useful for the trend methods from the Search API since they include attributes names that are actually timestamps. The only way to get to those now is to use send to do a method invocation.