Method: Scimitar::Schema::Attribute#initialize

Defined in:
app/models/scimitar/schema/attribute.rb

#initialize(options = {}) ⇒ Attribute

options

Hash of values to be used for instantiating the attribute object. Some of the instance variables of the objects will have default values if this hash does not contain anything for them.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'app/models/scimitar/schema/attribute.rb', line 37

def initialize(options = {})
  defaults = {
    multiValued:     false,
    required:        false,
    caseExact:       false,
    mutability:      'readWrite',
    uniqueness:      'none',
    returned:        'default',
    canonicalValues: []
  }

  if options[:complexType]
    defaults.merge!(type: 'complex', subAttributes: options[:complexType].schema.scim_attributes)
  end

  super(defaults.merge(options || {}))
end