Class: ROM::LDAP::Schema::AttributesInferrer Private

Inherits:
Object
  • Object
show all
Extended by:
Initializer
Defined in:
lib/rom/ldap/schema/attributes_inferrer.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(schema, gateway) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rom/ldap/schema/attributes_inferrer.rb', line 18

def call(schema, gateway)
  dataset = schema.name.dataset
  columns = dataset_attributes(gateway, dataset)

  inferred = columns.map do |name|
    type = type_builder.call(name, schema.name)
    attr_class.new(type, name: name.to_sym)
  end

  missing = columns - inferred.map { |attr| attr.meta[:name] }

  [inferred, missing]
end

#with(new_options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/rom/ldap/schema/attributes_inferrer.rb', line 33

def with(new_options)
  self.class.new(options.merge(new_options))
end