Class: Chewy::Index::Witchcraft::Cauldron

Inherits:
Object
  • Object
show all
Defined in:
lib/chewy/index/witchcraft.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index, fields: []) ⇒ Cauldron

Returns a new instance of Cauldron.

Parameters:

  • index (Chewy::Index)

    index for composition

  • fields (Array<Symbol>) (defaults to: [])

    restricts the fields for composition



48
49
50
51
52
# File 'lib/chewy/index/witchcraft.rb', line 48

def initialize(index, fields: [])
  @index = index
  @locals = []
  @fields = fields
end

Instance Attribute Details

#localsObject (readonly)

Returns the value of attribute locals.



44
45
46
# File 'lib/chewy/index/witchcraft.rb', line 44

def locals
  @locals
end

Instance Method Details

#brew(object, crutches = nil) ⇒ Object



54
55
56
# File 'lib/chewy/index/witchcraft.rb', line 54

def brew(object, crutches = nil)
  alicorn.call(locals, object, crutches).as_json
end