Method: ActiveSupport::Inflector::Inflections#clear

Defined in:
lib/active_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, :acronyms.

clear :all
clear :plurals


231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/active_support/inflector/inflections.rb', line 231

def clear(scope = :all)
  case scope
  when :all
    clear(:acronyms)
    clear(:plurals)
    clear(:singulars)
    clear(:uncountables)
    clear(:humans)
  when :acronyms
    @acronyms = {}
    define_acronym_regex_patterns
  when :uncountables
    @uncountables = Uncountables.new
  when :plurals, :singulars, :humans
    instance_variable_set "@#{scope}", []
  end
end