agent_orange icon indicating copy to clipboard operation
agent_orange copied to clipboard

README out of date

Open afeld opened this issue 13 years ago • 2 comments

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

afeld avatar Nov 20 '12 04:11 afeld

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 [email protected] 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.

kevinelliott avatar Nov 20 '12 04:11 kevinelliott

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

afeld avatar Nov 20 '12 04:11 afeld