Method: Chewy::Type::Import::ClassMethods#compose
- Defined in:
- lib/chewy/type/import.rb
#compose(object, crutches = nil, fields: []) ⇒ Hash
Composes a single document from the passed object. Uses either witchcraft or normal composing under the hood.
116 117 118 119 120 121 122 123 124 |
# File 'lib/chewy/type/import.rb', line 116 def compose(object, crutches = nil, fields: []) crutches ||= Chewy::Type::Crutch::Crutches.new self, [object] if witchcraft? && root.children.present? cauldron(fields: fields).brew(object, crutches) else root.compose(object, crutches, fields: fields) end end |