Class: SGF::Variation
- Inherits:
-
Object
- Object
- SGF::Variation
- Defined in:
- lib/sgf/variation.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #append(node) ⇒ Object
-
#initialize ⇒ Variation
constructor
A new instance of Variation.
- #size ⇒ Object
Constructor Details
#initialize ⇒ Variation
3 4 5 6 |
# File 'lib/sgf/variation.rb', line 3 def initialize @root = SGF::Node.new @size = 1 end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
2 3 4 |
# File 'lib/sgf/variation.rb', line 2 def root @root end |
Instance Method Details
#append(node) ⇒ Object
8 9 10 11 |
# File 'lib/sgf/variation.rb', line 8 def append node @root.add_children node @size += 1 end |
#size ⇒ Object
13 14 15 |
# File 'lib/sgf/variation.rb', line 13 def size @size end |