Skip to content

Instantly share code, notes, and snippets.

Avatar

Michel Löhr mlohr

  • Dresden, Germany
View GitHub Profile
@adomokos
adomokos / visitor_pattern_example.rb
Created May 24, 2011
The Visitor Pattern implementation in Ruby from the Wikipedia example
View visitor_pattern_example.rb
class CarElement
def accept(visitor)
raise NotImpelementedError.new
end
end
module Visitable
def accept(visitor)
visitor.visit(self)
end