class DrawUml::Tree::Branch
Attributes
entries[R]
Public Class Methods
new(path, level=0, trunk=nil)
click to toggle source
Calls superclass method
DrawUml::Tree::Leaf::new
# File lib/draw_uml/tree/branch.rb, line 6 def initialize(path, level=0, trunk=nil) super @entries = [] node end
Public Instance Methods
each(&block)
click to toggle source
# File lib/draw_uml/tree/branch.rb, line 16 def each(&block) entries.each do |entry| block.call(entry) entry.each(&block) if entry.is_a?(DrawUml::Tree::Branch) end end
leaf?()
click to toggle source
# File lib/draw_uml/tree/branch.rb, line 12 def leaf? false end
Private Instance Methods
node()
click to toggle source
# File lib/draw_uml/tree/branch.rb, line 24 def node Dir[File.join(path, '*')].each do |path| if File.directory?(path) entries << DrawUml::Tree::Branch.new(path, level, trunk) else entries << DrawUml::Tree::Leaf.new(path, level, trunk) end end end