Class: Coradoc::Reference::Presentation::CustomHierarchy::VisitorById
- Inherits:
-
Object
- Object
- Coradoc::Reference::Presentation::CustomHierarchy::VisitorById
- Defined in:
- lib/coradoc/reference/presentation/custom_hierarchy.rb
Overview
Single-purpose visitor: walks a CoreModel tree looking for one node by id. Cleaner than a recursive method on the presentation class itself.
Instance Attribute Summary collapse
-
#found ⇒ Object
readonly
Returns the value of attribute found.
Instance Method Summary collapse
-
#initialize(target_id) ⇒ VisitorById
constructor
A new instance of VisitorById.
- #visit(node) ⇒ Object
Constructor Details
#initialize(target_id) ⇒ VisitorById
Returns a new instance of VisitorById.
74 75 76 77 |
# File 'lib/coradoc/reference/presentation/custom_hierarchy.rb', line 74 def initialize(target_id) @target_id = target_id @found = nil end |
Instance Attribute Details
#found ⇒ Object (readonly)
Returns the value of attribute found.
72 73 74 |
# File 'lib/coradoc/reference/presentation/custom_hierarchy.rb', line 72 def found @found end |