Class: Leftovers::Processors::AddSuffix

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

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

Constructor Details

#initialize(suffix, then_processor) ⇒ AddSuffix

Returns a new instance of AddSuffix.



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

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

  freeze
end

Instance Method Details

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



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

def process(str, current_node, matched_node, acc)
  return unless str

  @then_processor.process("#{str}#{@suffix}", current_node, matched_node, acc)
end