Module: Pluralize

Defined in:
lib/hippo/templates/liquid/pluralize.rb

Instance Method Summary collapse

Instance Method Details

#pluralize(number, singular, plural = nil) ⇒ Object


3
4
5
6
7
8
9
10
11
12
# File 'lib/hippo/templates/liquid/pluralize.rb', line 3

def pluralize(number, singular, plural = nil)
    number = number.to_i
    if number == 1
        "#{number} #{singular}"
    elsif plural.nil?
        "#{number} #{singular}s"
    else
        "#{number} #{plural}"
    end
end