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


460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/sup/util.rb', line 460

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

#to_characterObject


451
452
453
454
455
456
457
# File 'lib/sup/util.rb', line 451

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