Class: Soar::Authentication::IdentityUuidTranslator::RoleGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/soar/authentication/identity_uuid_translator/role_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(directory) ⇒ RoleGenerator

Returns a new instance of RoleGenerator.



6
7
8
# File 'lib/soar/authentication/identity_uuid_translator/role_generator.rb', line 6

def initialize(directory)
  @directory = directory
end

Instance Method Details

#generate(role) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/soar/authentication/identity_uuid_translator/role_generator.rb', line 10

def generate(role)
  begin 
    @directory.put(role)
  rescue Soar::Registry::Directory::Error::DuplicateEntryError => e
    true
  end
end