Class: Espago::Response
- Inherits:
-
Object
- Object
- Espago::Response
- Defined in:
- lib/espago/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #amount ⇒ Object
- #card ⇒ Object
- #client ⇒ Object
- #created_at ⇒ Object
- #currency ⇒ Object
- #description ⇒ Object
-
#initialize(response) ⇒ Response
constructor
A new instance of Response.
- #response_id ⇒ Object
- #state ⇒ Object
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
8 9 10 |
# File 'lib/espago/response.rb', line 8 def initialize(response) @body = parse(response) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/espago/response.rb', line 6 def body @body end |
Instance Method Details
#amount ⇒ Object
20 21 22 |
# File 'lib/espago/response.rb', line 20 def amount body["amount"] end |
#card ⇒ Object
40 41 42 |
# File 'lib/espago/response.rb', line 40 def card body["card"] || {} end |
#client ⇒ Object
32 33 34 |
# File 'lib/espago/response.rb', line 32 def client body["client"] end |
#created_at ⇒ Object
36 37 38 |
# File 'lib/espago/response.rb', line 36 def created_at body["client"] end |
#currency ⇒ Object
24 25 26 |
# File 'lib/espago/response.rb', line 24 def currency body["currency"] end |
#description ⇒ Object
16 17 18 |
# File 'lib/espago/response.rb', line 16 def description body["description"] end |
#response_id ⇒ Object
12 13 14 |
# File 'lib/espago/response.rb', line 12 def response_id body["id"] end |
#state ⇒ Object
28 29 30 |
# File 'lib/espago/response.rb', line 28 def state body["state"] end |