Class: D3TreeGraph
- Inherits:
-
Object
- Object
- D3TreeGraph
- Defined in:
- lib/giblish/indexbuilders/d3treegraph.rb
Overview
Generate asciidoc that represents a given pathtree as a verbatim block with indented, clickable entries.
Instance Attribute Summary collapse
-
#tree ⇒ Object
readonly
Returns the value of attribute tree.
Instance Method Summary collapse
-
#initialize(tree:, options: {dir_index_base_name: "index"}) ⇒ D3TreeGraph
constructor
tree: PathTree === Required node data methods title docid.
- #source ⇒ Object
Constructor Details
#initialize(tree:, options: {dir_index_base_name: "index"}) ⇒ D3TreeGraph
tree: PathTree
Required node data methods
title docid
options: dir_index_base_name: String - the basename of the index file residing in each directory
14 15 16 17 |
# File 'lib/giblish/indexbuilders/d3treegraph.rb', line 14 def initialize(tree:, options: {dir_index_base_name: "index"}) @tree = transform_data(tree) @options = end |
Instance Attribute Details
#tree ⇒ Object (readonly)
Returns the value of attribute tree.
4 5 6 |
# File 'lib/giblish/indexbuilders/d3treegraph.rb', line 4 def tree @tree end |
Instance Method Details
#source ⇒ Object
19 20 21 22 |
# File 'lib/giblish/indexbuilders/d3treegraph.rb', line 19 def source erb_template = File.read("#{__dir__}/templates/tree.html.erb") ERB.new(erb_template, trim_mode: "<>").result(binding) end |