Class: Blood::Node
Instance Method Summary collapse
- #children_for_tree_html ⇒ Object
- #css_for_tree_html ⇒ Object
-
#initialize(mod, hier) ⇒ Node
constructor
A new instance of Node.
- #label_for_tree_html ⇒ Object
Constructor Details
#initialize(mod, hier) ⇒ Node
Returns a new instance of Node.
24 25 26 27 |
# File 'lib/blood.rb', line 24 def initialize(mod, hier) @mod = mod @hier = hier end |
Instance Method Details
#children_for_tree_html ⇒ Object
34 35 36 |
# File 'lib/blood.rb', line 34 def children_for_tree_html children.map{ |sub| Node.new(sub, @hier) } end |
#css_for_tree_html ⇒ Object
38 39 40 |
# File 'lib/blood.rb', line 38 def css_for_tree_html '.hl{color: #cc342d;}' end |
#label_for_tree_html ⇒ Object
29 30 31 32 |
# File 'lib/blood.rb', line 29 def label_for_tree_html name = ::CGI.escapeHTML(@mod.to_s) Class === @mod ? "<span class='hl'>#{name}</span>" : name end |