a

Ruby code posted
created at 02 Jul 09:49

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Bottles
  # ...
  def verse(number)
    bottle_number      = BottleNumber.new(number)
    next_bottle_number = BottleNumber.new(bottle_number.successor)
    "#{bottle_number} ".capitalize +
      "of milk on the wall, " +
    "#{bottle_number} of milk.\n" +
    "#{bottle_number.action} " +
    "#{next_bottle_number} " +
      "of milk on the wall.\n"
  end
  # ...
end
391 Bytes in 5 ms with coderay