Class: EY::GateKeeper::Token

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_dataObject (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

Returns:

  • (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_sObject



23
24
25
# File 'lib/ey_gatekeeper/token.rb', line 23

def to_s
  token
end

#tokenObject



19
20
21
# File 'lib/ey_gatekeeper/token.rb', line 19

def token
  @token_data['token']
end