Class: Boletoman::Services::Itau::Token::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/boletoman/services/itau/token/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Response

Returns a new instance of Response.



8
9
10
# File 'lib/boletoman/services/itau/token/response.rb', line 8

def initialize(raw)
  @raw = JSON.parse(raw.body)
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



6
7
8
# File 'lib/boletoman/services/itau/token/response.rb', line 6

def raw
  @raw
end

Instance Method Details

#expires_inObject



16
17
18
# File 'lib/boletoman/services/itau/token/response.rb', line 16

def expires_in
  raw["expires_in"] - 3
end

#tokenObject



12
13
14
# File 'lib/boletoman/services/itau/token/response.rb', line 12

def token
  raw["access_token"]
end