class Soar::Registry::Identity::Provider::Customer::ClientNumber

Public Class Methods

new(directory:, fetch_index: , search_index: ) click to toggle source

@param [Soar::Registry::Directory] directory @param [String] fetch_index @param [String] search_index

# File lib/soar/registry/identity/provider/customer/client_number.rb, line 15
def initialize(directory:, fetch_index: , search_index: )
  @directory = directory
  @fetch_index = fetch_index
  @search_index = search_index
end

Public Instance Methods

calculate_all_attributes(identity) click to toggle source

@param [Hash] identity @return [Hash] Hash of attributes keyed by role

# File lib/soar/registry/identity/provider/customer/client_number.rb, line 64
def calculate_all_attributes(identity)
  raise NotImplementedError
end
calculate_attributes(identity, role) click to toggle source

@param [Hash] identity @param [String] role @return [Hash] A hash of attributes

# File lib/soar/registry/identity/provider/customer/client_number.rb, line 57
def calculate_attributes(identity, role)
  raise NotImplementedError
end
calculate_identifiers(identity) click to toggle source

@param [Hash] identity @return [Array] list of identifiers

# File lib/soar/registry/identity/provider/customer/client_number.rb, line 37
def calculate_identifiers(identity)
  indexes = @directory.index
  identifiers = []
  indexes.each { |index| 
    identifiers << identity[index]
  }
  identifiers.compact
end
calculate_identities(client_number) click to toggle source

@param [String] client_number

a client_number that uniquely identifies an identity

@return [Hash] an identity

# File lib/soar/registry/identity/provider/customer/client_number.rb, line 26
def calculate_identities(client_number)
  return @identities if not @identities.nil?
  entries = @directory.search(@search_index, client_number)
  @identities = entries.empty? ? [] : [entries[0]]
  return @identities
end
calculate_roles(identity) click to toggle source

@param [Hash] identity @return [Array] list of roles

# File lib/soar/registry/identity/provider/customer/client_number.rb, line 49
def calculate_roles(identity)
  raise NotImplementedError
end