kevinelliott / agent_orange

Parse and process User Agents like a secret one
126 stars 36 forks source link

README out of date #29

Open afeld opened 11 years ago

afeld commented 11 years ago

The types returned from each method/attribute are really confusing - for example here:

> platform = ua.device.platform
=> "iPhone"

where ua.device.platform actually returns a AgentOrange::Platform object. Am I missing something? Documenting with YARD would be awesome, too...

http://rubydoc.info/gems/agent_orange/frames

kevinelliott commented 11 years ago

The reason that could return "iPhone" is because to_s is defined on AgentOrange::Platform, and so it will have a string representation of the object, rather than the object itself. Where possible, I have tried to define to_s on each class.

Good idea about YARD, I'll look into it.

On Nov 19, 2012, at 8:43 PM, Aidan Feldman notifications@github.com wrote:

The types returned from each method/attribute are really confusing - for example here:

platform = ua.device.platform => "iPhone" where ua.device.platform actually returns a AgentOrange::Platform object. Am I missing something? Documenting with YARD would be awesome, too...

http://rubydoc.info/gems/agent_orange/frames

— Reply to this email directly or view it on GitHub.

afeld commented 11 years ago

Right - I just think this would be less confusing:

> platform = ua.device.platform
=> #<AgentOrange::Platform:...>
> platform.to_s
=> "iPhone"
> platform.type
=> :apple # not "iphone" - this is incorrect in the README, FYI