Module: Alba::DefaultInflector

Defined in:
lib/alba/default_inflector.rb

Overview

This module has two purposes. One is that we require ‘active_support/inflector` in this module so that we don’t do that all over the place. Another is that ‘ActiveSupport::Inflector` doesn’t have ‘camelize_lower` method that we want it to have, so this module works as an adapter.

Class Method Summary collapse

Class Method Details

.camelize(key) ⇒ Object



26
# File 'lib/alba/default_inflector.rb', line 26

delegate :camelize, :dasherize, :underscore, :classify, :demodulize, :pluralize, to: ActiveSupport::Inflector

.camelize_lower(key) ⇒ String

Camelizes a key, 1st letter lowercase

Parameters:

  • key (String)

    key to be camelized

Returns:

  • (String)

    camelized key



33
34
35
# File 'lib/alba/default_inflector.rb', line 33

def self.camelize_lower(key)
  ActiveSupport::Inflector.camelize(key, false)
end

.classify(key) ⇒ Object



26
# File 'lib/alba/default_inflector.rb', line 26

delegate :camelize, :dasherize, :underscore, :classify, :demodulize, :pluralize, to: ActiveSupport::Inflector

.dasherize(key) ⇒ Object



26
# File 'lib/alba/default_inflector.rb', line 26

delegate :camelize, :dasherize, :underscore, :classify, :demodulize, :pluralize, to: ActiveSupport::Inflector

.demodulize(key) ⇒ Object



26
# File 'lib/alba/default_inflector.rb', line 26

delegate :camelize, :dasherize, :underscore, :classify, :demodulize, :pluralize, to: ActiveSupport::Inflector

.pluralize(key) ⇒ Object



26
# File 'lib/alba/default_inflector.rb', line 26

delegate :camelize, :dasherize, :underscore, :classify, :demodulize, :pluralize, to: ActiveSupport::Inflector

.underscore(key) ⇒ Object



26
# File 'lib/alba/default_inflector.rb', line 26

delegate :camelize, :dasherize, :underscore, :classify, :demodulize, :pluralize, to: ActiveSupport::Inflector