Module: R10K::Action::Visitor Private
- Included in:
- Deploy::Display, Deploy::Environment, Deploy::Module
- Defined in:
- lib/r10k/action/visitor.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Implement the Visitor pattern via pseudo double dispatch.
Visitor classes must implement #visit_type methods for each type that may be visited. If the visitor should descend into child objects the #visit_ method should yield to the passed block.
Visitor classes must implement #logger so that error messages can be logged.
Instance Method Summary collapse
-
#visit(type, other, &block) ⇒ void
private
Dispatch to the type specific visitor method.
Instance Method Details
#visit(type, other, &block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Dispatch to the type specific visitor method
23 24 25 26 27 28 |
# File 'lib/r10k/action/visitor.rb', line 23 def visit(type, other, &block) send("visit_#{type}", other, &block) rescue => e logger.error R10K::Errors::Formatting.format_exception(e, @trace) @visit_ok = false end |