Sha256: 7367d7f183e1a9431d6a1d0fa3e0c644ad1d369077f3da74d8813ad40aaf6ef2

Contents?: true

Size: 540 Bytes

Versions: 62

Compression:

Stored size: 540 Bytes

Contents

module Xcake
  # This namespace provides all of methods for
  # implementing the Visitable in the  Visitor pattern.
  #
  module Visitable
    # This method accepts the visitors.
    #
    # The default implementatio lets the
    # visitor visit then leave.
    #
    # Override this if you need to allow
    # visitors to visit properties of a
    # class.
    #
    # @param [Visitor] visitor
    #                  the visitor to accept
    #
    def accept(visitor)
      visitor.visit(self)
      visitor.leave(self)
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
xcake-0.1.6 lib/xcake/visitable.rb
xcake-0.1.5 lib/xcake/visitable.rb