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

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

Overview

Represents an application SCIM configuration.

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http: Scim::Kit::Http.new) {|Builder.new(self)| ... } ⇒ Configuration

Returns a new instance of Configuration.

Yields:



43
44
45
46
47
48
49
# File 'lib/scim/kit/v2/configuration.rb', line 43

def initialize(http: Scim::Kit::Http.new)
  @http = http
  @resource_types = {}
  @schemas = {}

  yield Builder.new(self) if block_given?
end

Instance Attribute Details

#resource_typesObject



40
41
42
# File 'lib/scim/kit/v2/configuration.rb', line 40

def resource_types
  @resource_types
end

#schemasObject



41
42
43
# File 'lib/scim/kit/v2/configuration.rb', line 41

def schemas
  @schemas
end

#service_provider_configurationObject



39
40
41
# File 'lib/scim/kit/v2/configuration.rb', line 39

def service_provider_configuration
  @service_provider_configuration
end

Instance Method Details

#load_from(base_url) ⇒ Object



51
52
53
54
55
56
57
58
59
60
# File 'lib/scim/kit/v2/configuration.rb', line 51

def load_from(base_url)
  base_url = "#{base_url}/"
  uri = URI.join(base_url, 'ServiceProviderConfig')
  json = http.get(uri)

  self.service_provider_configuration = ServiceProviderConfiguration.parse(json, json)

  load_items(base_url, 'Schemas', Schema, schemas)
  load_items(base_url, 'ResourceTypes', ResourceType, resource_types)
end