Class: EY::GateKeeper::Token
- Inherits:
-
Object
- Object
- EY::GateKeeper::Token
- Defined in:
- lib/ey_gatekeeper/token.rb
Instance Attribute Summary collapse
-
#token_data ⇒ Object
readonly
Returns the value of attribute token_data.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(token_data) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
- #token ⇒ Object
Constructor Details
#initialize(token_data) ⇒ Token
Returns a new instance of Token.
7 8 9 |
# File 'lib/ey_gatekeeper/token.rb', line 7 def initialize(token_data) @token_data = token_data end |
Instance Attribute Details
#token_data ⇒ Object (readonly)
Returns the value of attribute token_data.
5 6 7 |
# File 'lib/ey_gatekeeper/token.rb', line 5 def token_data @token_data end |
Instance Method Details
#expired? ⇒ Boolean
11 12 13 14 15 16 17 |
# File 'lib/ey_gatekeeper/token.rb', line 11 def expired? if @token_data['expires'] Time.now.utc.to_i >= @token_data['expires'].to_i else true end end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/ey_gatekeeper/token.rb', line 23 def to_s token end |
#token ⇒ Object
19 20 21 |
# File 'lib/ey_gatekeeper/token.rb', line 19 def token @token_data['token'] end |