Module: Faceted::HasObject::ClassMethods

Defined in:
lib/faceted/has_object.rb

Instance Method Summary collapse

Instance Method Details

#fieldsObject



7
8
9
# File 'lib/faceted/has_object.rb', line 7

def fields
  @fields ||= [:id]
end

#materialize(objects = [], args = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/faceted/has_object.rb', line 11

def materialize(objects=[], args={})
  objects.compact.inject([]) do |a, object|
    instance = self.new
    instance.send(:object=, object)
    instance.send(:initialize_with_object)
    instance.send(:excludes=, args[:excludes]) if args[:excludes]
    a << instance
  end
end