跳至内容 跳至搜索
方法
#
A
D
N
U

类公共方法

new()

# File activesupport/lib/active_support/inflector/inflections.rb, line 34
def initialize
  @regex_array = []
  super
end

实例公共方法

<<(*word)

# File activesupport/lib/active_support/inflector/inflections.rb, line 44
def <<(*word)
  add(word)
end

add(words)

# 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

delete(entry)

# File activesupport/lib/active_support/inflector/inflections.rb, line 39
def delete(entry)
  super entry
  @regex_array.delete(to_regex(entry))
end

uncountable?(str)

# File activesupport/lib/active_support/inflector/inflections.rb, line 55
def uncountable?(str)
  @regex_array.any? { |regex| regex.match? str }
end