Module: Bridgetown::Foundation::RefineExt::String

Included in:
Refinements
Defined in:
bridgetown-foundation/lib/bridgetown/foundation/refine_ext/string.rb

Class Method Summary collapse

Class Method Details

.string_inflectorObject

Support string convenience methods for Dry::Inflector methods



7
8
9
10
11
12
13
14
15
# File 'bridgetown-foundation/lib/bridgetown/foundation/refine_ext/string.rb', line 7

def self.string_inflector
  # Always use the current configured site inflector, if available
  if defined?(Bridgetown::Current) &&
      Bridgetown::Current.preloaded_configuration.is_a?(Bridgetown::Configuration)
    return Bridgetown::Current.preloaded_configuration.inflector
  end

  @string_inflector ||= Bridgetown::Foundation::Inflector.new
end