Class: PayPal::AccessToken
- Inherits:
-
Object
- Object
- PayPal::AccessToken
- Defined in:
- lib/core/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
- #authorizationString ⇒ Object
-
#initialize(options) ⇒ AccessToken
constructor
A new instance of AccessToken.
- #isExpired ⇒ Object
Constructor Details
#initialize(options) ⇒ AccessToken
Returns a new instance of AccessToken.
5 6 7 8 9 10 |
# File 'lib/core/access_token.rb', line 5 def initialize() @access_token = .access_token @token_type = .token_type @expires_in = .expires_in @date_created = Time.now end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/core/access_token.rb', line 3 def access_token @access_token end |
#date_created ⇒ Object
Returns the value of attribute date_created.
3 4 5 |
# File 'lib/core/access_token.rb', line 3 def date_created @date_created end |
#expires_in ⇒ Object
Returns the value of attribute expires_in.
3 4 5 |
# File 'lib/core/access_token.rb', line 3 def expires_in @expires_in end |
#token_type ⇒ Object
Returns the value of attribute token_type.
3 4 5 |
# File 'lib/core/access_token.rb', line 3 def token_type @token_type end |
Instance Method Details
#authorizationString ⇒ Object
16 17 18 |
# File 'lib/core/access_token.rb', line 16 def return "#{@token_type} #{@access_token}" end |
#isExpired ⇒ Object
12 13 14 |
# File 'lib/core/access_token.rb', line 12 def isExpired return Time.now > @date_created + @expires_in end |