Class: MoneyMover::Dwolla::Token
- Inherits:
-
Object
- Object
- MoneyMover::Dwolla::Token
- Defined in:
- lib/money_mover/dwolla/token.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#_links ⇒ Object
readonly
Returns the value of attribute _links.
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#refresh_expires_in ⇒ Object
readonly
Returns the value of attribute refresh_expires_in.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#token_type ⇒ Object
readonly
Returns the value of attribute token_type.
Instance Method Summary collapse
-
#initialize(attrs = {}, ach_config = Config.new, client = Client.new) ⇒ Token
constructor
A new instance of Token.
- #request_new_token! ⇒ Object
Constructor Details
#initialize(attrs = {}, ach_config = Config.new, client = Client.new) ⇒ Token
Returns a new instance of Token.
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/money_mover/dwolla/token.rb', line 6 def initialize(attrs={}, ach_config = Config.new, client = Client.new) @_links = attrs[:_links] @account_id = attrs[:account_id] @expires_in = attrs[:expires_in] @refresh_expires_in = attrs[:refresh_expires_in] @access_token = attrs[:access_token] @refresh_token = attrs[:refresh_token] @token_type = attrs[:token_type] @scope = attrs[:scope] @ach_config = ach_config @client = client end |
Instance Attribute Details
#_links ⇒ Object (readonly)
Returns the value of attribute _links.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def _links @_links end |
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def access_token @access_token end |
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def account_id @account_id end |
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def expires_in @expires_in end |
#refresh_expires_in ⇒ Object (readonly)
Returns the value of attribute refresh_expires_in.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def refresh_expires_in @refresh_expires_in end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def refresh_token @refresh_token end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def scope @scope end |
#token_type ⇒ Object (readonly)
Returns the value of attribute token_type.
4 5 6 |
# File 'lib/money_mover/dwolla/token.rb', line 4 def token_type @token_type end |
Instance Method Details
#request_new_token! ⇒ Object
20 21 22 23 |
# File 'lib/money_mover/dwolla/token.rb', line 20 def request_new_token! response = @client.post @client.token_url, create_params Token.new response.body end |