class ActiveSupport::Inflector::Inflections::Uncountables
Inherits From
-
class
Array
Public class methods
Source code GitHub
# File activesupport/lib/active_support/inflector/inflections.rb, line 34
def initialize
@regex_array = []
super
end
Public instance methods
Source code GitHub
# File activesupport/lib/active_support/inflector/inflections.rb, line 44
def <<(*word)
add(word)
end
Source code GitHub
# File activesupport/lib/active_support/inflector/inflections.rb, line 48
def add(words)
words = words.flatten.map(&:downcase)
concat(words)
@regex_array += words.map { |word| to_regex(word) }
self
end
Source code GitHub
# File activesupport/lib/active_support/inflector/inflections.rb, line 39
def delete(entry)
super entry
@regex_array.delete(to_regex(entry))
end
Source code GitHub
# File activesupport/lib/active_support/inflector/inflections.rb, line 55
def uncountable?(str)
@regex_array.any? { |regex| regex.match? str }
end