Class: Integer
Instance Method Summary collapse
-
#pluralize(s) ⇒ Object
hacking the english language.
- #to_character ⇒ Object
Instance Method Details
#pluralize(s) ⇒ Object
hacking the english language
455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/sup/util.rb', line 455 def pluralize s to_s + " " + if self == 1 s else if s =~ /(.*)y$/ $1 + "ies" else s + "s" end end end |
#to_character ⇒ Object
446 447 448 449 450 451 452 |
# File 'lib/sup/util.rb', line 446 def to_character if self < 128 && self >= 0 chr else "<#{self}>" end end |