Class: BandPage::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/band_page/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject

Returns the value of attribute expires_at.



3
4
5
# File 'lib/band_page/token.rb', line 3

def expires_at
  @expires_at
end

#stringObject

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

Returns:

  • (Boolean)


9
10
11
# File 'lib/band_page/token.rb', line 9

def expired?
  @expires_at < Time.now
end