Class: Scim::Kit::V2::Configuration::Builder
- Inherits:
-
Object
- Object
- Scim::Kit::V2::Configuration::Builder
- Defined in:
- lib/scim/kit/v2/configuration.rb
Instance Method Summary collapse
- #apply_to(configuration) ⇒ Object
-
#initialize ⇒ Builder
constructor
A new instance of Builder.
- #resource_type(id:, location:) {|| ... } ⇒ Object
- #schema(id:, name:, location:) {|| ... } ⇒ Object
- #service_provider_configuration(location:) {|@sp_config| ... } ⇒ Object
Constructor Details
#initialize ⇒ Builder
Returns a new instance of Builder.
10 11 12 13 |
# File 'lib/scim/kit/v2/configuration.rb', line 10 def initialize @resource_types = {} @schemas = {} end |
Instance Method Details
#apply_to(configuration) ⇒ Object
31 32 33 34 35 |
# File 'lib/scim/kit/v2/configuration.rb', line 31 def apply_to(configuration) configuration.service_provider_configuration = @sp_config configuration.resource_types = @resource_types configuration.schemas = @schemas end |
#resource_type(id:, location:) {|| ... } ⇒ Object
20 21 22 23 24 |
# File 'lib/scim/kit/v2/configuration.rb', line 20 def resource_type(id:, location:) @resource_types[id] ||= ResourceType.new(location: location) @resource_types[id].id = id yield @resource_types[id] end |
#schema(id:, name:, location:) {|| ... } ⇒ Object
26 27 28 29 |
# File 'lib/scim/kit/v2/configuration.rb', line 26 def schema(id:, name:, location:) @schemas[id] ||= Schema.new(id: id, name: name, location: location) yield @schemas[id] end |
#service_provider_configuration(location:) {|@sp_config| ... } ⇒ Object
15 16 17 18 |
# File 'lib/scim/kit/v2/configuration.rb', line 15 def service_provider_configuration(location:) @sp_config = ServiceProviderConfiguration.new(location: location) yield @sp_config end |