Class: Caster::Remove

Inherits:
Object
  • Object
show all
Defined in:
lib/caster/transform/remove.rb

Instance Method Summary collapse

Constructor Details

#initialize(field) ⇒ Remove

Returns a new instance of Remove.



6
7
8
9
# File 'lib/caster/transform/remove.rb', line 6

def initialize field
  @field = field
  @accessor = Accessor.new
end

Instance Method Details

#execute(doc) ⇒ Object



11
12
13
14
# File 'lib/caster/transform/remove.rb', line 11

def execute doc
  @accessor.delete doc, @field
  doc
end