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.
47 48 49 50 |
# File 'lib/blood.rb', line 47 def initialize(mod, hier) @mod = mod @hier = hier end |
Instance Method Details
#children_for_tree_html ⇒ Object
57 58 59 |
# File 'lib/blood.rb', line 57 def children_for_tree_html children.map{ |sub| Node.new(sub, @hier) } end |
#css_for_tree_html ⇒ Object
61 62 63 |
# File 'lib/blood.rb', line 61 def css_for_tree_html '.hl{color: #cc342d;}' end |
#label_for_tree_html ⇒ Object
52 53 54 55 |
# File 'lib/blood.rb', line 52 def label_for_tree_html name = ::CGI.escapeHTML(@mod.to_s) Class === @mod ? "<span class='hl'>#{name}</span>" : name end |