class

Inflector::Inflections

rails latest stable - Superclass: Object

Class deprecated or moved

This class is deprecated or moved on the latest stable version. The last existing version (v2.1.0) is shown here.

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

  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.

Included modules

  • Singleton

Attributes

[R]plurals
[R]singulars
[R]uncountables

Files

  • activesupport/lib/active_support/inflector.rb