Sha256: 7fff44f481c5412ad5750f1a40e7b5ea8c039ffcd05b25692aee9e5e2820cfcb

Contents?: true

Size: 455 Bytes

Versions: 3

Compression:

Stored size: 455 Bytes

Contents

# encoding: utf-8

module Axiom

  # A mixin to allow instances to be visited
  module Visitable

    # Accept a visitor and dispatch the object to the visitor
    #
    # @example
    #   visitable = visitable.accept(visitor)
    #
    # @param [#visit] visitor
    #   the visitor object
    #
    # @return [self]
    #
    # @api public
    def accept(visitor)
      visitor.visit(self)
      self
    end

  end # module Visitable
end # module Axiom

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
axiom-0.2.0 lib/axiom/support/visitable.rb
axiom-0.1.1 lib/axiom/support/visitable.rb
axiom-0.1.0 lib/axiom/support/visitable.rb