class

ActiveSupport::Inflector::Inflections

v3.2.8 - Show latest stable - Superclass: Object

A singleton instance of this class is yielded by Inflector.inflections, which can then be used to specify additional inflection rules. Examples:

ActiveSupport::Inflector.inflections do |inflect|
  inflect.plural /^(ox)$/i, '\1\2en'
  inflect.singular /^(ox)en/i, '\1'

  inflect.irregular 'octopus', 'octopi'

  inflect.uncountable "equipment"
end

New rules are added at the top. So in the example above, the irregular rule for octopus will now be the first of the pluralization and singularization rules that is runs. This guarantees that your rules run before any of the rules that may already have been loaded.

Attributes

[R]acronym_regex
[R]acronyms
[R]humans
[R]plurals
[R]singulars
[R]uncountables

Files

  • activesupport/lib/active_support/inflector/inflections.rb