Class: Adp::Connection::AccessToken
- Inherits:
-
Object
- Object
- Adp::Connection::AccessToken
- Defined in:
- lib/adp/access_token.rb
Instance Attribute Summary collapse
-
#_expires_in ⇒ Object
Returns the value of attribute _expires_in.
-
#expires_on ⇒ Object
Returns the value of attribute expires_on.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#token ⇒ Object
Returns the value of attribute token.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Instance Method Summary collapse
- #expires_in ⇒ Object
- #expires_in=(value) ⇒ Object
- #initialize(config = nil) ⇒ Object constructor
- #is_valid? ⇒ Boolean
Constructor Details
#initialize(config = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/adp/access_token.rb', line 13 def initialize(config = nil) unless config.nil? self.token = config["access_token"] self.token_type = config["token_type"] self.scope = config["scope"] self.expires_in = config["expires_in"] end end |
Instance Attribute Details
#_expires_in ⇒ Object
Returns the value of attribute _expires_in.
10 11 12 |
# File 'lib/adp/access_token.rb', line 10 def _expires_in @_expires_in end |
#expires_on ⇒ Object
Returns the value of attribute expires_on.
8 9 10 |
# File 'lib/adp/access_token.rb', line 8 def expires_on @expires_on end |
#scope ⇒ Object
Returns the value of attribute scope.
7 8 9 |
# File 'lib/adp/access_token.rb', line 7 def scope @scope end |
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/adp/access_token.rb', line 5 def token @token end |
#token_type ⇒ Object
Returns the value of attribute token_type.
6 7 8 |
# File 'lib/adp/access_token.rb', line 6 def token_type @token_type end |
Instance Method Details
#expires_in ⇒ Object
33 34 35 |
# File 'lib/adp/access_token.rb', line 33 def expires_in return self._expires_in end |
#expires_in=(value) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/adp/access_token.rb', line 24 def expires_in=(value) unless value.nil? self._expires_in = value self.expires_on = Time.new() + self._expires_in end self.expires_on end |
#is_valid? ⇒ Boolean
37 38 39 |
# File 'lib/adp/access_token.rb', line 37 def is_valid? return true; end |