Class: Espago::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/espago/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



6
7
8
# File 'lib/espago/response.rb', line 6

def body
  @body
end

Instance Method Details

#amountObject



20
21
22
# File 'lib/espago/response.rb', line 20

def amount
  body["amount"]
end

#cardObject



40
41
42
# File 'lib/espago/response.rb', line 40

def card
  body["card"] || {}
end

#clientObject



32
33
34
# File 'lib/espago/response.rb', line 32

def client
  body["client"]
end

#created_atObject



36
37
38
# File 'lib/espago/response.rb', line 36

def created_at
  body["client"]
end

#currencyObject



24
25
26
# File 'lib/espago/response.rb', line 24

def currency
  body["currency"]
end

#descriptionObject



16
17
18
# File 'lib/espago/response.rb', line 16

def description
  body["description"]
end

#response_idObject



12
13
14
# File 'lib/espago/response.rb', line 12

def response_id
  body["id"]
end

#stateObject



28
29
30
# File 'lib/espago/response.rb', line 28

def state
  body["state"]
end