May 29, 2006

ruby.design.patterns

Some of the patterns are built in Ruby library, like Singleton so we can simply use it like that:
require 'singleton'

class QueenMotherBee
include Singleton
end

qbee1 = QueenMotherBee.instance
qbee2 = QueenMotherBee.instance

print qbee1, " = ", qbee2, "n"
Singleton is a module :.. some info about using modules.
There are some interesting resources on web about patterns in Ruby, like [...]