Class: ZeroRailsAdapter::Identity

Inherits:
Data
  • Object
show all
Defined in:
lib/zero_rails_adapter/identity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_id: nil, current_user: nil, claims: {}) ⇒ Identity

Returns a new instance of Identity.



5
6
7
# File 'lib/zero_rails_adapter/identity.rb', line 5

def initialize(user_id: nil, current_user: nil, claims: {})
  super(user_id: user_id&.to_s, current_user:, claims: claims || {})
end

Instance Attribute Details

#claimsObject (readonly)

Returns the value of attribute claims

Returns:

  • (Object)

    the current value of claims



4
5
6
# File 'lib/zero_rails_adapter/identity.rb', line 4

def claims
  @claims
end

#current_userObject (readonly)

Returns the value of attribute current_user

Returns:

  • (Object)

    the current value of current_user



4
5
6
# File 'lib/zero_rails_adapter/identity.rb', line 4

def current_user
  @current_user
end

#user_idObject (readonly)

Returns the value of attribute user_id

Returns:

  • (Object)

    the current value of user_id



4
5
6
# File 'lib/zero_rails_adapter/identity.rb', line 4

def user_id
  @user_id
end