Class: CheckoutSdk::OAuthAccessToken
- Inherits:
-
Object
- Object
- CheckoutSdk::OAuthAccessToken
- Defined in:
- lib/checkout_sdk/oauth_access_token.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
Constructor Details
#initialize(token, expiration_date) ⇒ OAuthAccessToken
15 16 17 18 |
# File 'lib/checkout_sdk/oauth_access_token.rb', line 15 def initialize(token, expiration_date) @token = token @expiration_date = expiration_date end |
Instance Attribute Details
#expiration_date ⇒ Time
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/checkout_sdk/oauth_access_token.rb', line 8 class OAuthAccessToken attr_accessor :token, :expiration_date # @param [String] token # @param [Time] expiration_date # @return [OAuthAccessToken] def initialize(token, expiration_date) @token = token @expiration_date = expiration_date end # @return [TrueClass, FalseClass] def valid? return false if @token.nil? @expiration_date > Time.now end end |
#token ⇒ String
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/checkout_sdk/oauth_access_token.rb', line 8 class OAuthAccessToken attr_accessor :token, :expiration_date # @param [String] token # @param [Time] expiration_date # @return [OAuthAccessToken] def initialize(token, expiration_date) @token = token @expiration_date = expiration_date end # @return [TrueClass, FalseClass] def valid? return false if @token.nil? @expiration_date > Time.now end end |
Instance Method Details
#valid? ⇒ TrueClass, FalseClass
21 22 23 24 25 |
# File 'lib/checkout_sdk/oauth_access_token.rb', line 21 def valid? return false if @token.nil? @expiration_date > Time.now end |