Class: Fixnum

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

Instance Method Summary collapse

Instance Method Details

#ordObject



411
412
413
# File 'lib/sup/util.rb', line 411

def ord
  self
end

#pluralize(s) ⇒ Object

hacking the english language



417
418
419
420
421
422
423
424
425
426
427
428
# File 'lib/sup/util.rb', line 417

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

#to_characterObject



402
403
404
405
406
407
408
# File 'lib/sup/util.rb', line 402

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