Class: Blood::Node
Constant Summary collapse
- NORMAL_NAME =
/^[A-Z][A-Za-z0-9]*(::[A-Z][A-Za-z0-9]*)*$/
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
- #raw_label_for_tree_html ⇒ Object
Constructor Details
#initialize(mod, hier) ⇒ Node
Returns a new instance of Node.
50 51 52 53 |
# File 'lib/blood.rb', line 50 def initialize(mod, hier) @mod = mod @hier = hier end |
Instance Method Details
#children_for_tree_html ⇒ Object
75 76 77 |
# File 'lib/blood.rb', line 75 def children_for_tree_html children.map{ |sub| Node.new(sub, @hier) } end |
#css_for_tree_html ⇒ Object
79 80 81 |
# File 'lib/blood.rb', line 79 def css_for_tree_html '.hl{color: #cc342d;} .sd{color: #9e9e9e;}' end |
#label_for_tree_html ⇒ Object
55 56 57 58 |
# File 'lib/blood.rb', line 55 def label_for_tree_html name = ::CGI.escapeHTML(@mod.name || @mod.to_s) Class === @mod ? "<span class='hl'>#{name}</span>" : name end |
#raw_label_for_tree_html ⇒ Object
63 64 65 66 |
# File 'lib/blood.rb', line 63 def label_for_tree_html name = ::CGI.escapeHTML(@mod.name || @mod.to_s) Class === @mod ? "<span class='hl'>#{name}</span>" : name end |