Sha256: 8a1a9da2e84db0c16f878d94069bc84ab16f07dc17efe689d422a667802a475a

Contents?: true

Size: 277 Bytes

Versions: 2

Compression:

Stored size: 277 Bytes

Contents

class Integer
  def pluralize(desc)
    if self == 0
      "no #{desc.to_s.pluralize}"
    elsif self == 1
      "#{self} #{desc}"
    else
      "#{self} #{desc.to_s.pluralize}"
    end
  end

  def dotted
    self.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1.').reverse
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lux-fw-0.2.3 ./lib/overload/integer.rb
lux-fw-0.2.1 ./lib/overload/integer.rb