I've tried to use ActiveSupport's (2.3-stable) try() on an instance of HttpParty::Response. I've got a pretty strange behavior:
> ro.parsed_response
{"error"=>"RecordInvalid", "description"=>"Record validation errors", "details"=>{"email"=> [{"description"=>"Email: foo@bar.com is already taken by another user"}]}}
> ro.try(:parsed_response)
NoMethodError Exception: undefined method `parsed_response' for #<Hash:0x11397d5d8>
In the first example, I send the parsed_response message to ro by using the dot notation. It works fine. In the second one, I try to call it using ActiveSupport's try(), and it (surprisingly) raises the NoMethodError exception.
Shouldn't try() have returned nil in this case? And why doesn't it find the "parsed_response" method, if I can call it using the dot notation, as seen in the first example?
Thanks in advance!