Class: Trivet::TraverseControl
- Inherits:
-
Object
- Object
- Trivet::TraverseControl
- Defined in:
- lib/trivet.rb
Overview
Objects of this class control the Trivet::Node#traverse method. You generally will not need to instantiate this object yourself. See Trivet::Node#traverse for details.
Instance Attribute Summary collapse
-
#pruned ⇒ Object
Returns true if the traversal is being pruned.
-
#stopped ⇒ Object
readonly
Returns true if the traversal has been stopped.
Instance Method Summary collapse
-
#initialize ⇒ TraverseControl
constructor
————————————————————————— initialize.
-
#prune ⇒ Object
Prunes the traversal so that the process does not recurse into children.
-
#stop ⇒ Object
Stops the traversal completely.
Constructor Details
#initialize ⇒ TraverseControl
initialize
1605 1606 1607 1608 |
# File 'lib/trivet.rb', line 1605 def initialize @pruned = false @stopped = false end |
Instance Attribute Details
#pruned ⇒ Object
Returns true if the traversal is being pruned.
1619 1620 1621 |
# File 'lib/trivet.rb', line 1619 def pruned @pruned end |
#stopped ⇒ Object (readonly)
Returns true if the traversal has been stopped.
1622 1623 1624 |
# File 'lib/trivet.rb', line 1622 def stopped @stopped end |
Instance Method Details
#prune ⇒ Object
Prunes the traversal so that the process does not recurse into children.
1634 1635 1636 |
# File 'lib/trivet.rb', line 1634 def prune @pruned = true end |
#stop ⇒ Object
Stops the traversal completely.
1639 1640 1641 |
# File 'lib/trivet.rb', line 1639 def stop @stopped = true end |