Sha256: b249623027c6304cb808345c60769a532760c0ec41030d8ca5d4a5523ba7cbbe

Contents?: true

Size: 459 Bytes

Versions: 4

Compression:

Stored size: 459 Bytes

Contents

# encoding: utf-8

module Veritas

  # 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 Veritas

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veritas-0.0.7 lib/veritas/support/visitable.rb
veritas-0.0.6 lib/veritas/support/visitable.rb
veritas-0.0.5 lib/veritas/support/visitable.rb
veritas-0.0.4 lib/veritas/support/visitable.rb