Method: DataMapper::Inflector::Inflections#clear
- Defined in:
- lib/dm-core/support/inflector/inflections.rb
#clear(scope = :all) ⇒ Object
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.
Examples:
clear :all
clear :plurals
96 97 98 99 100 101 102 103 |
# File 'lib/dm-core/support/inflector/inflections.rb', line 96 def clear(scope = :all) case scope when :all @plurals, @singulars, @uncountables = [], [], [] else instance_variable_set "@#{scope}", [] end end |