Class: Moneybird::Token
- Inherits:
-
Object
- Object
- Moneybird::Token
- Defined in:
- lib/moneybird/token.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#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
-
#client ⇒ Object
Create a Client from this token.
-
#initialize(access_token:, refresh_token: nil, token_type: "bearer", scope: nil, created_at: nil) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(access_token:, refresh_token: nil, token_type: "bearer", scope: nil, created_at: nil) ⇒ Token
Returns a new instance of Token.
7 8 9 10 11 12 13 |
# File 'lib/moneybird/token.rb', line 7 def initialize(access_token:, refresh_token: nil, token_type: "bearer", scope: nil, created_at: nil) @access_token = access_token @refresh_token = refresh_token @token_type = token_type @scope = scope @created_at = created_at.is_a?(Numeric) ? Time.at(created_at) : created_at end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/moneybird/token.rb', line 5 def access_token @access_token end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/moneybird/token.rb', line 5 def created_at @created_at end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token.
5 6 7 |
# File 'lib/moneybird/token.rb', line 5 def refresh_token @refresh_token end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
5 6 7 |
# File 'lib/moneybird/token.rb', line 5 def scope @scope end |
#token_type ⇒ Object (readonly)
Returns the value of attribute token_type.
5 6 7 |
# File 'lib/moneybird/token.rb', line 5 def token_type @token_type end |