instance method
clear
Ruby on Rails 7.1.6
Since v2.2.3Signature
clear(scope = :all)
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
Parameters
-
scopeopt = :all
Source
# File activesupport/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
Defined in activesupport/lib/active_support/inflector/inflections.rb line 231
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Inflector::Inflections