Sha256: f15f9340b9b2b16bd64ff569be000e2fd3f54f81dd14a2c90a7a7af923d6f896

Contents?: true

Size: 345 Bytes

Versions: 2

Compression:

Stored size: 345 Bytes

Contents

module MultiSync
  module Helpers
    module Pluralize
      def pluralize(n, singular, plural = nil, prefix = true)
        if n == 1
          (prefix ? '1 ' : '') + singular
        elsif plural
          (prefix ? "#{n} " : '') + plural
        else
          (prefix ? "#{n} " : '') + "#{singular}s"
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
multi_sync-0.0.4 lib/multi_sync/helpers/pluralize.rb
multi_sync-0.0.3 lib/multi_sync/helpers/pluralize.rb