Design patterns implementation in Ruby