Class: Leftovers::Processors::Camelize
- Inherits:
-
Object
- Object
- Leftovers::Processors::Camelize
- Includes:
- ComparableInstance
- Defined in:
- lib/leftovers/processors/camelize.rb
Instance Method Summary collapse
-
#initialize(then_processor) ⇒ Camelize
constructor
A new instance of Camelize.
- #process(str, current_node, matched_node, acc) ⇒ Object
Methods included from ComparableInstance
Constructor Details
#initialize(then_processor) ⇒ Camelize
Returns a new instance of Camelize.
8 9 10 11 12 |
# File 'lib/leftovers/processors/camelize.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 20 21 22 23 |
# File 'lib/leftovers/processors/camelize.rb', line 14 def process(str, current_node, matched_node, acc) return unless str @then_processor.process(str.camelize, current_node, matched_node, acc) rescue ::NoMethodError ::Leftovers.error <<~MESSAGE Tried using the ::String#camelize method, but the activesupport gem was not available and/or not required `gem install activesupport`, and/or add `requires: ['active_support', 'active_support/core_ext/string']` to your .leftovers.yml MESSAGE end |