Class: TreeOrganizer::Node
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#issue ⇒ Object
Returns the value of attribute issue.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #children? ⇒ Boolean
-
#initialize(issue: nil) ⇒ Node
constructor
A new instance of Node.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(issue: nil) ⇒ Node
Returns a new instance of Node.
10 11 12 13 |
# File 'lib/jirametrics/tree_organizer.rb', line 10 def initialize issue: nil @issue = issue @children = [] end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
8 9 10 |
# File 'lib/jirametrics/tree_organizer.rb', line 8 def children @children end |
#issue ⇒ Object
Returns the value of attribute issue.
7 8 9 |
# File 'lib/jirametrics/tree_organizer.rb', line 7 def issue @issue end |
#parent ⇒ Object
Returns the value of attribute parent.
7 8 9 |
# File 'lib/jirametrics/tree_organizer.rb', line 7 def parent @parent end |
Instance Method Details
#<=>(other) ⇒ Object
23 24 25 |
# File 'lib/jirametrics/tree_organizer.rb', line 23 def <=> other issue <=> other.issue end |
#children? ⇒ Boolean
27 28 29 |
# File 'lib/jirametrics/tree_organizer.rb', line 27 def children? !@children.empty? end |
#inspect ⇒ Object
19 20 21 |
# File 'lib/jirametrics/tree_organizer.rb', line 19 def inspect to_s end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/jirametrics/tree_organizer.rb', line 15 def to_s "Node(#{@issue&.key || 'Root'}, parent: #{@parent&.issue&.key || 'Root'}, children: #{@children.inspect})" end |