Class: RDoc::Generator::SDoc::FilesTree

Inherits:
Object
  • Object
show all
Defined in:
lib/sdoc/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



218
219
220
# File 'lib/sdoc/generator.rb', line 218

def children
  @children
end

Instance Method Details

#add(path, url) ⇒ Object



219
220
221
222
223
224
225
226
227
228
# File 'lib/sdoc/generator.rb', line 219

def add(path, url)
  path = path.split(File::SEPARATOR) unless Array === path
  @children ||= {}
  if path.length == 1
    @children[path.first] = url
  else
    @children[path.first] ||= FilesTree.new
    @children[path.first].add(path[1, path.length], url)
  end
end