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



453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/sup/util.rb', line 453

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

#to_characterObject



444
445
446
447
448
449
450
# File 'lib/sup/util.rb', line 444

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