Class: CassetteRack::Tree::Branch

Inherits:
Leaf
  • Object
show all
Defined in:
lib/cassette-rack/tree/branch.rb

Instance Attribute Summary collapse

Attributes inherited from Leaf

#id, #level, #name, #path, #trunk

Instance Method Summary collapse

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

#entriesObject (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

Returns:

  • (Boolean)


12
13
14
# File 'lib/cassette-rack/tree/branch.rb', line 12

def leaf?
  false
end