Class: RShade::EventTreeNode
- Includes:
- Enumerable
- Defined in:
- lib/rshade/event_tree.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#vlevel ⇒ Object
readonly
Returns the value of attribute vlevel.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(value, level, parent = nil) ⇒ EventTreeNode
constructor
A new instance of EventTreeNode.
Constructor Details
#initialize(value, level, parent = nil) ⇒ EventTreeNode
Returns a new instance of EventTreeNode.
50 51 52 53 54 55 56 |
# File 'lib/rshade/event_tree.rb', line 50 def initialize(value, level, parent=nil) @children = [] @level = level @parent = parent @value = value @vlevel = set_vlevel(parent) end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
47 48 49 |
# File 'lib/rshade/event_tree.rb', line 47 def children @children end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
47 48 49 |
# File 'lib/rshade/event_tree.rb', line 47 def level @level end |
#parent ⇒ Object
Returns the value of attribute parent.
48 49 50 |
# File 'lib/rshade/event_tree.rb', line 48 def parent @parent end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
47 48 49 |
# File 'lib/rshade/event_tree.rb', line 47 def value @value end |
#vlevel ⇒ Object (readonly)
Returns the value of attribute vlevel.
47 48 49 |
# File 'lib/rshade/event_tree.rb', line 47 def vlevel @vlevel end |
Instance Method Details
#each(&block) ⇒ Object
58 59 60 61 |
# File 'lib/rshade/event_tree.rb', line 58 def each(&block) block.call(self) if parent != nil || value != nil children.each { |item| item.each(&block) } end |