Class: TreeRepl::CmdNode
Class Attribute Summary collapse
-
.classes2tree_nodes ⇒ Object
Returns the value of attribute classes2tree_nodes.
Instance Attribute Summary collapse
-
#cmd ⇒ Object
readonly
Returns the value of attribute cmd.
Attributes inherited from TreeNode
Instance Method Summary collapse
- #find_children ⇒ Object
-
#initialize(obj, cmd, name) ⇒ CmdNode
constructor
A new instance of CmdNode.
Methods inherited from TreeNode
Constructor Details
#initialize(obj, cmd, name) ⇒ CmdNode
Returns a new instance of CmdNode.
33 34 35 36 37 |
# File 'lib/treerepl/tree.rb', line 33 def initialize(obj,cmd,name) @obj = obj @cmd = cmd @name = name || cmd.to_s end |
Class Attribute Details
.classes2tree_nodes ⇒ Object
Returns the value of attribute classes2tree_nodes.
29 30 31 |
# File 'lib/treerepl/tree.rb', line 29 def classes2tree_nodes @classes2tree_nodes end |
Instance Attribute Details
#cmd ⇒ Object (readonly)
Returns the value of attribute cmd.
26 27 28 |
# File 'lib/treerepl/tree.rb', line 26 def cmd @cmd end |
Instance Method Details
#find_children ⇒ Object
38 39 40 |
# File 'lib/treerepl/tree.rb', line 38 def find_children @obj.send(@cmd).map {|v| CmdNode.classes2tree_nodes[v.class].new v} end |