Class: Chewy::Type::Witchcraft::Cauldron
- Defined in:
- lib/chewy/type/witchcraft.rb
Instance Attribute Summary collapse
-
#locals ⇒ Object
readonly
Returns the value of attribute locals.
Instance Method Summary collapse
- #brew(object, crutches = nil) ⇒ Object
-
#initialize(type, fields: []) ⇒ Cauldron
constructor
A new instance of Cauldron.
Constructor Details
#initialize(type, fields: []) ⇒ Cauldron
Returns a new instance of Cauldron.
48 49 50 51 52 |
# File 'lib/chewy/type/witchcraft.rb', line 48 def initialize(type, fields: []) @type = type @locals = [] @fields = fields end |
Instance Attribute Details
#locals ⇒ Object (readonly)
Returns the value of attribute locals.
44 45 46 |
# File 'lib/chewy/type/witchcraft.rb', line 44 def locals @locals end |
Instance Method Details
#brew(object, crutches = nil) ⇒ Object
54 55 56 |
# File 'lib/chewy/type/witchcraft.rb', line 54 def brew(object, crutches = nil) alicorn.call(locals, object, crutches).as_json end |