 end end class IntegerNode < Node include Visitable attr_reader :value def initialize value @value = value end end class Ast < Node def initialize @nodes = [] @nodes << IntegerNode . new ( 0 ) @nodes << IntegerNode . new ( 0 ) end def accept visitor @nodes . each do | node | node . accept visitor end end end class 