Class: Fixnum

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

Instance Method Summary collapse

Instance Method Details

#ordObject



514
515
516
# File 'lib/sup/util.rb', line 514

def ord
  self
end

#pluralize(s) ⇒ Object

hacking the english language



520
521
522
523
524
525
526
527
528
529
530
531
# File 'lib/sup/util.rb', line 520

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

#to_characterObject



505
506
507
508
509
510
511
# File 'lib/sup/util.rb', line 505

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