Class: Leftovers::Processors::Swapcase

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

Instance Method Summary collapse

Methods included from ComparableInstance

#eql?, #hash

Constructor Details

#initialize(then_processor) ⇒ Swapcase

Returns a new instance of Swapcase.



8
9
10
11
12
# File 'lib/leftovers/processors/swapcase.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
# File 'lib/leftovers/processors/swapcase.rb', line 14

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

  @then_processor.process(str.swapcase, current_node, matched_node, acc)
end