Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/string.rb

Instance Method Summary collapse

Instance Method Details

#pluralize(count = nil, locale = :en) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/string.rb', line 6

def pluralize(count = nil, locale = :en)
  if locale == :ru
    case count
    when :many
      I18n.t('cases.')
    end
  else
    locale = count if count.is_a? Symbol
    count == 1 ? dup : ActiveSupport::Inflector.pluralize(self, locale)
  end
end