Class: Boletoman::Services::Itau::Token::Response
- Inherits:
-
Object
- Object
- Boletoman::Services::Itau::Token::Response
- Defined in:
- lib/boletoman/services/itau/token/response.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #expires_in ⇒ Object
-
#initialize(raw) ⇒ Response
constructor
A new instance of Response.
- #token ⇒ Object
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
#raw ⇒ Object (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_in ⇒ Object
16 17 18 |
# File 'lib/boletoman/services/itau/token/response.rb', line 16 def expires_in raw["expires_in"] - 3 end |
#token ⇒ Object
12 13 14 |
# File 'lib/boletoman/services/itau/token/response.rb', line 12 def token raw["access_token"] end |