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