Class: PayPal::AccessToken
- Inherits:
-
Object
- Object
- PayPal::AccessToken
- Defined in:
- lib/paypal/access_token.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#date_created ⇒ Object
Returns the value of attribute date_created.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Instance Method Summary collapse
- #authorization_string ⇒ Object
- #expired? ⇒ Boolean
-
#initialize(options) ⇒ AccessToken
constructor
A new instance of AccessToken.
Constructor Details
#initialize(options) ⇒ AccessToken
Returns a new instance of AccessToken.
7 8 9 10 11 12 |
# File 'lib/paypal/access_token.rb', line 7 def initialize() @access_token = .access_token @token_type = .token_type @expires_in = .expires_in @date_created = Time.zone.now end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
5 6 7 |
# File 'lib/paypal/access_token.rb', line 5 def access_token @access_token end |
#date_created ⇒ Object
Returns the value of attribute date_created.
5 6 7 |
# File 'lib/paypal/access_token.rb', line 5 def date_created @date_created end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
5 6 7 |
# File 'lib/paypal/access_token.rb', line 5 def expires_in @expires_in end |
#token_type ⇒ Object
Returns the value of attribute token_type.
5 6 7 |
# File 'lib/paypal/access_token.rb', line 5 def token_type @token_type end |
Instance Method Details
#authorization_string ⇒ Object
18 19 20 |
# File 'lib/paypal/access_token.rb', line 18 def "#{@token_type} #{@access_token}" end |
#expired? ⇒ Boolean
14 15 16 |
# File 'lib/paypal/access_token.rb', line 14 def expired? Time.zone.now > @date_created + @expires_in end |