Class: FreshBooks::Response
- Inherits:
-
Hash
- Object
- Hash
- FreshBooks::Response
- Defined in:
- lib/freshbooks.rb
Overview
provides a Hash-like response object with structure isomorphic to actual xml response, slightly tidied.
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(data) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Response
Returns a new instance of Response.
14 15 16 17 18 19 20 |
# File 'lib/freshbooks.rb', line 14 def initialize(data) super nil response = data["response"] response.delete "xmlns" @status = response.delete "status" update response end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
12 13 14 |
# File 'lib/freshbooks.rb', line 12 def status @status end |
Instance Method Details
#success? ⇒ Boolean
22 23 24 |
# File 'lib/freshbooks.rb', line 22 def success? status == "ok" end |