Class: Leftovers::Processors::ReplaceValue

Inherits:
Object
  • Object
show all
Includes:
ComparableInstance
Defined in:
lib/leftovers/processors/replace_value.rb

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

Constructor Details

#initialize(value, then_processor) ⇒ ReplaceValue

Returns a new instance of ReplaceValue.



8
9
10
11
12
13
# File 'lib/leftovers/processors/replace_value.rb', line 8

def initialize(value, then_processor)
  @value = value
  @then_processor = then_processor

  freeze
end

Instance Method Details

#process(_str, current_node, matched_node, acc) ⇒ Object



15
16
17
# File 'lib/leftovers/processors/replace_value.rb', line 15

def process(_str, current_node, matched_node, acc)
  @then_processor.process(@value, current_node, matched_node, acc)
end