Class: BandPage::Token
- Inherits:
-
Object
- Object
- BandPage::Token
- Defined in:
- lib/band_page/token.rb
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(string, expires_in) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(string, expires_in) ⇒ Token
Returns a new instance of Token.
4 5 6 7 |
# File 'lib/band_page/token.rb', line 4 def initialize(string, expires_in) @string = string @expires_at = Time.now + expires_in.to_i end |
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at.
3 4 5 |
# File 'lib/band_page/token.rb', line 3 def expires_at @expires_at end |
#string ⇒ Object
Returns the value of attribute string.
3 4 5 |
# File 'lib/band_page/token.rb', line 3 def string @string end |
Instance Method Details
#expired? ⇒ Boolean
9 10 11 |
# File 'lib/band_page/token.rb', line 9 def expired? @expires_at < Time.now end |