Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/kin/core_ext/string.rb
Instance Method Summary collapse
-
#numericise(amount) ⇒ String
Pluralises
selfaccording to theamount.
Instance Method Details
#numericise(amount) ⇒ String
Pluralises self according to the amount.
17 18 19 20 21 22 23 |
# File 'lib/kin/core_ext/string.rb', line 17 def numericise(amount) case amount when 0, nil then "no #{plural}" when 1 then "one #{self}" else "#{amount.to_s} #{plural}" end end |