Class: Layer::IdentityToken

Inherits:
Object
  • Object
show all
Defined in:
lib/layer/identity_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ IdentityToken

Returns a new instance of IdentityToken.



5
6
7
8
9
# File 'lib/layer/identity_token.rb', line 5

def initialize(options = {})
  @user_id = options[:user_id]
  @nonce = options[:nonce]
  @expires_at = (options[:expires_at] || Time.now+(1209600))
end

Instance Attribute Details

#expires_atObject (readonly)

Returns the value of attribute expires_at.



3
4
5
# File 'lib/layer/identity_token.rb', line 3

def expires_at
  @expires_at
end

#nonceObject (readonly)

Returns the value of attribute nonce.



3
4
5
# File 'lib/layer/identity_token.rb', line 3

def nonce
  @nonce
end

#user_idObject (readonly)

Returns the value of attribute user_id.



3
4
5
# File 'lib/layer/identity_token.rb', line 3

def user_id
  @user_id
end

Instance Method Details

#layer_key_idObject



15
16
17
# File 'lib/layer/identity_token.rb', line 15

def layer_key_id
  ENV['LAYER_KEY_ID']
end

#layer_provider_idObject



19
20
21
# File 'lib/layer/identity_token.rb', line 19

def layer_provider_id
  ENV['LAYER_PROVIDER_ID']
end

#to_sObject



11
12
13
# File 'lib/layer/identity_token.rb', line 11

def to_s
  get_jwt
end