Top Level Namespace

Defined Under Namespace

Modules: Executor, Paradeiser Classes: Numeric

Instance Method Summary collapse

Instance Method Details

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

stand-in for ‘action_view/helpers/text_helper’



2
3
4
5
6
7
8
9
10
# File 'lib/paradeiser/refinements/pluralize.rb', line 2

def pluralize(count, singular, plural = nil)
  word = if (count == 1 || count =~ /^1(\.0+)?$/)
    singular
  else
    plural || singular.pluralize
  end

  "#{count || 0} #{word}"
end