Class: ApipieBindings::Inflector

Inherits:
Object
  • Object
show all
Defined in:
lib/apipie_bindings/inflector.rb

Class Method Summary collapse

Class Method Details

.inflections(locale = :en) ⇒ Object



92
93
94
95
96
97
98
# File 'lib/apipie_bindings/inflector.rb', line 92

def self.inflections(locale = :en)
  if block_given?
    yield ApipieBindings::Inflections.instance(locale)
  else
    ApipieBindings::Inflections.instance(locale)
  end
end

.pluralize(word, locale = :en) ⇒ Object



84
85
86
# File 'lib/apipie_bindings/inflector.rb', line 84

def self.pluralize(word, locale = :en)
  apply_inflections(word, inflections(locale).plurals)
end

.singularize(word, locale = :en) ⇒ Object



88
89
90
# File 'lib/apipie_bindings/inflector.rb', line 88

def self.singularize(word, locale = :en)
  apply_inflections(word, inflections(locale).singulars)
end