Class: Fixnum

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

Instance Method Summary collapse

Instance Method Details

#ordObject



438
439
440
# File 'lib/sup/util.rb', line 438

def ord
  self
end

#pluralize(s) ⇒ Object

hacking the english language



444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/sup/util.rb', line 444

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

#to_characterObject



429
430
431
432
433
434
435
# File 'lib/sup/util.rb', line 429

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