classify

classify(table_name) Instance Public methods Create a class name from a plural table name like Rails does for table names to models. Note that this returns a string and not a Class (To convert to an actual class follow classify with constantize). 'egg_and_hams'.classify # => "EggAndHam" 'posts'.classify # => "Post" Singular names are not handled correctly: 'calculus'.classify # => "Calculu"

camelize

camelize(term, uppercase_first_letter = true) Instance Public methods By default, camelize converts strings to UpperCamelCase. If the argument to camelize is set to :lower then camelize produces lowerCamelCase. camelize will also convert '/' to '::' which is useful for converting paths to namespaces. 'active_model'.camelize # => "ActiveModel" 'active_model'.camelize(:lower) # => "activeModel" 'active_model/errors'.camelize # => "ActiveModel::E

uncountable

uncountable(*words) Instance Public methods Add uncountable words that shouldn't be attempted inflected. uncountable 'money' uncountable 'money', 'information' uncountable %w( money information rice )

singular

singular(rule, replacement) Instance Public methods Specifies a new singularization rule and its replacement. The rule can either be a string or a regular expression. The replacement should always be a string that may include references to the matched data from the rule.

plural

plural(rule, replacement) Instance Public methods Specifies a new pluralization rule and its replacement. The rule can either be a string or a regular expression. The replacement should always be a string that may include references to the matched data from the rule.

irregular

irregular(singular, plural) Instance Public methods Specifies a new irregular that applies to both pluralization and singularization at the same time. This can only be used for strings, not regular expressions. You simply pass the irregular in singular and plural form. irregular 'octopus', 'octopi' irregular 'person', 'people'

human

human(rule, replacement) Instance Public methods Specifies a humanized form of a string by a regular expression rule or by a string mapping. When using a regular expression based replacement, the normal humanize formatting is called after the replacement. When a string is used, the human form should be specified as desired (example: 'The name', not 'the_name'). human /_cnt$/i, '\1_count' human 'legacy_col_person_name', 'Name'

clear

clear(scope = :all) Instance Public methods Clears the loaded inflections within a given scope (default is :all). Give the scope as a symbol of the inflection type, the options are: :plurals, :singulars, :uncountables, :humans. clear :all clear :plurals

acronym

acronym(word) Instance Public methods Specifies a new acronym. An acronym must be specified as it will appear in a camelized string. An underscore string that contains the acronym will retain the acronym when passed to camelize, humanize, or titleize. A camelized string that contains the acronym will maintain the acronym when titleized or humanized, and will convert the acronym into a non-delimited single lowercase word when passed to underscore. acronym 'HTML' titleize 'html'

new

new() Class Public methods