Class: Trivet::TraverseControl

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeTraverseControl


initialize



1370
1371
1372
1373
# File 'lib/trivet.rb', line 1370

def initialize
	@pruned = false
	@stopped = false
end

Instance Attribute Details

#prunedObject

Returns true if the traversal is being pruned.



1384
1385
1386
# File 'lib/trivet.rb', line 1384

def pruned
  @pruned
end

#stoppedObject (readonly)

Returns true if the traversal has been stopped.



1387
1388
1389
# File 'lib/trivet.rb', line 1387

def stopped
  @stopped
end

Instance Method Details

#pruneObject

Prunes the traversal so that the process does not recurse into children.



1399
1400
1401
# File 'lib/trivet.rb', line 1399

def prune
	@pruned = true
end

#stopObject

Stops the traversal completely.



1404
1405
1406
# File 'lib/trivet.rb', line 1404

def stop
	@stopped = true
end