class Leftovers::ValueProcessors::Deconstantize

Public Class Methods

new(then_processor) click to toggle source
# File lib/leftovers/value_processors/deconstantize.rb, line 6
def initialize(then_processor)
  @then_processor = then_processor

  freeze
end

Public Instance Methods

process(str, node, method_node) click to toggle source
# File lib/leftovers/value_processors/deconstantize.rb, line 12
      def process(str, node, method_node)
        return unless str

        @then_processor.process(str.deconstantize, node, method_node)
      rescue NoMethodError
        Leftovers.error <<~MESSAGE
          Tried using the String#deconstantize method, but the activesupport gem was not available and/or not required
          `gem install activesupport`, and/or add `requires: 'active_support/core_ext/string'` to your .leftovers.yml
        MESSAGE
      end