Methods
Class Public methods
new()
📝 Source code
# File activesupport/lib/active_support/inflector/inflections.rb, line 35
def initialize
@regex_array = []
super
end
🔎 See on GitHub
Instance Public methods
<<(*word)
📝 Source code
# File activesupport/lib/active_support/inflector/inflections.rb, line 45
def <<(*word)
add(word)
end
🔎 See on GitHub
add(words)
📝 Source code
# File activesupport/lib/active_support/inflector/inflections.rb, line 49
def add(words)
words = words.flatten.map(&:downcase)
concat(words)
@regex_array += words.map { |word| to_regex(word) }
self
end
🔎 See on GitHub
delete(entry)
📝 Source code
# File activesupport/lib/active_support/inflector/inflections.rb, line 40
def delete(entry)
super entry
@regex_array.delete(to_regex(entry))
end
🔎 See on GitHub
uncountable?(str)
📝 Source code
# File activesupport/lib/active_support/inflector/inflections.rb, line 56
def uncountable?(str)
@regex_array.any? { |regex| regex.match? str }
end
🔎 See on GitHub