class Trusona::Resources::UserIdentifier

a relying party specific user identifier

Attributes

identifier[R]
trusona_id[R]

Public Class Methods

new(params = {}) click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 11
def initialize(params = {})
  @params     = params
  @identifier = params[:identifier]
  @trusona_id = params[:trusona_id]
  @id         = @identifier
end

Public Instance Methods

to_h() click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 18
def to_h
  @params
end
to_json(*_args) click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 22
def to_json(*_args)
  JSON(to_h)
end
valid?() click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 26
def valid?
  validate
end
validate() click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 30
def validate
  attributes_present && attributes_filled
end

Private Instance Methods

attributes_filled() click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 43
def attributes_filled
  return false if @params.fetch(:identifier).empty?
  return false if @params.fetch(:trusona_id).empty?

  true
end
attributes_present() click to toggle source
# File lib/trusona/resources/user_identifier.rb, line 36
def attributes_present
  return false unless @params.key?(:identifier)
  return false unless @params.key?(:trusona_id)

  true
end