Class: Leftovers::Processors::Capitalize
- Inherits:
-
Object
- Object
- Leftovers::Processors::Capitalize
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/processors/capitalize.rb
Instance Method Summary collapse
-
#initialize(then_processor) ⇒ Capitalize
constructor
A new instance of Capitalize.
- #process(str, current_node, matched_node, acc) ⇒ Object
Methods included from ComparableInstance
Constructor Details
#initialize(then_processor) ⇒ Capitalize
Returns a new instance of Capitalize.
8 9 10 11 12 |
# File 'lib/leftovers/processors/capitalize.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/capitalize.rb', line 14 def process(str, current_node, matched_node, acc) return unless str @then_processor.process(str.capitalize, current_node, matched_node, acc) end |