Class: CassetteRack::Tree::Branch
- Defined in:
- lib/cassette-rack/tree/branch.rb
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Attributes inherited from Leaf
#id, #level, #name, #path, #trunk
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(path, level = 0, trunk = nil) ⇒ Branch
constructor
A new instance of Branch.
- #leaf? ⇒ Boolean
Constructor Details
#initialize(path, level = 0, trunk = nil) ⇒ Branch
Returns a new instance of Branch.
6 7 8 9 10 |
# File 'lib/cassette-rack/tree/branch.rb', line 6 def initialize(path, level=0, trunk=nil) super @entries = [] node end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
4 5 6 |
# File 'lib/cassette-rack/tree/branch.rb', line 4 def entries @entries end |
Instance Method Details
#each(&block) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/cassette-rack/tree/branch.rb', line 16 def each(&block) entries.each do |entry| block.call(entry) entry.each(&block) if entry.is_a?(CassetteRack::Tree::Branch) end end |
#leaf? ⇒ Boolean
12 13 14 |
# File 'lib/cassette-rack/tree/branch.rb', line 12 def leaf? false end |