Class: Leftovers::Processors::Receiver

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

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

Constructor Details

#initialize(then_processor) ⇒ Receiver

Returns a new instance of Receiver.



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

def initialize(then_processor)
  @then_processor = then_processor

  freeze
end

Instance Method Details

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



14
15
16
17
18
19
# File 'lib/leftovers/processors/receiver.rb', line 14

def process(_str, current_node, matched_node, acc)
  receiver = matched_node.receiver
  return unless receiver

  @then_processor.process(receiver.to_s, current_node, matched_node, acc)
end