Module: Scim::Kit::V2::Attributable

Included in:
Attribute, Resource
Defined in:
lib/scim/kit/v2/attributable.rb

Overview

Represents a dynamic attribute that corresponds to a SCIM type

Instance Method Summary collapse

Instance Method Details

#assign_attributes(attributes = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/scim/kit/v2/attributable.rb', line 16

def assign_attributes(attributes = {})
  attributes.each do |key, value|
    next if key.to_sym == :schemas

    if key.to_s.start_with?(Schemas::EXTENSION)
      assign_attributes(value)
    else
      write_attribute(key, value)
    end
  end
end

#define_attributes_for(resource, types) ⇒ Object



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

def define_attributes_for(resource, types)
  types.each { |x| attribute(x, resource) }
end

#dynamic_attributesObject



8
9
10
# File 'lib/scim/kit/v2/attributable.rb', line 8

def dynamic_attributes
  @dynamic_attributes ||= {}.with_indifferent_access
end