Class: Scim::Kit::V2::Configuration::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/scim/kit/v2/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ Builder

Returns a new instance of Builder.



12
13
14
# File 'lib/scim/kit/v2/configuration.rb', line 12

def initialize(configuration)
  @configuration = configuration
end

Instance Attribute Details

#configurationObject (readonly)



10
11
12
# File 'lib/scim/kit/v2/configuration.rb', line 10

def configuration
  @configuration
end

Instance Method Details

#resource_type(id:, location:) {|| ... } ⇒ Object

Yields:

  • ()


22
23
24
25
26
27
# File 'lib/scim/kit/v2/configuration.rb', line 22

def resource_type(id:, location:)
  configuration.resource_types[id] ||=
    ResourceType.new(location: location)
  configuration.resource_types[id].id = id
  yield configuration.resource_types[id]
end

#schema(id:, name:, location:) {|| ... } ⇒ Object

Yields:

  • ()


29
30
31
32
33
34
35
36
# File 'lib/scim/kit/v2/configuration.rb', line 29

def schema(id:, name:, location:)
  configuration.schemas[id] ||= Schema.new(
    id: id,
    name: name,
    location: location
  )
  yield configuration.schemas[id]
end

#service_provider_configuration(location:) {|configuration.service_provider_configuration| ... } ⇒ Object



16
17
18
19
20
# File 'lib/scim/kit/v2/configuration.rb', line 16

def service_provider_configuration(location:)
  configuration.service_provider_configuration =
    ServiceProviderConfiguration.new(location: location)
  yield configuration.service_provider_configuration
end