module Karafka::Helpers::Inflector
Inflector
provides inflection for the whole Karafka
framework with additional inflection caching (due to the fact, that Dry::Inflector is slow)
Constants
- ENGINE
What inflection engine do we want to use
Public Class Methods
map(string)
click to toggle source
@param string [String] string that we want to convert to our underscore format @return [String] inflected string @example
Karafka::Helpers::Inflector.map('Module/ControllerName') #=> 'module_controller_name'
# File lib/karafka/helpers/inflector.rb, line 20 def map(string) @map[string] ||= ENGINE.underscore(string).tr('/', '_') end