Class: Integer

Inherits:
Object show all
Defined in:
lib/sup/util.rb

Instance Method Summary collapse

Instance Method Details

#pluralize(s) ⇒ Object

hacking the english language



479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/sup/util.rb', line 479

def pluralize s
  to_s + " " +
    if self == 1
      s
    else
      if s =~ /(.*)y$/
        $1 + "ies"
      else
        s + "s"
      end
    end
end

#to_characterObject



470
471
472
473
474
475
476
# File 'lib/sup/util.rb', line 470

def to_character
  if self < 128 && self >= 0
    chr
  else
    "<#{self}>"
  end
end