Class: PGN::MoveText
- Inherits:
-
Object
- Object
- PGN::MoveText
- Defined in:
- lib/pgn/game.rb
Instance Attribute Summary collapse
-
#annotation ⇒ Object
Returns the value of attribute annotation.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#notation ⇒ Object
Returns the value of attribute notation.
-
#variations ⇒ Object
Returns the value of attribute variations.
Instance Method Summary collapse
- #==(m) ⇒ Object
- #eql?(m) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(notation, annotation = nil, comment = nil, variations = nil) ⇒ MoveText
constructor
A new instance of MoveText.
- #to_s ⇒ Object
Constructor Details
#initialize(notation, annotation = nil, comment = nil, variations = nil) ⇒ MoveText
Returns a new instance of MoveText.
7 8 9 10 11 12 |
# File 'lib/pgn/game.rb', line 7 def initialize(notation, annotation = nil, comment = nil, variations = nil) @notation = notation @annotation = annotation @comment = comment @variations = variations end |
Instance Attribute Details
#annotation ⇒ Object
Returns the value of attribute annotation.
5 6 7 |
# File 'lib/pgn/game.rb', line 5 def annotation @annotation end |
#comment ⇒ Object
Returns the value of attribute comment.
5 6 7 |
# File 'lib/pgn/game.rb', line 5 def comment @comment end |
#notation ⇒ Object
Returns the value of attribute notation.
5 6 7 |
# File 'lib/pgn/game.rb', line 5 def notation @notation end |
#variations ⇒ Object
Returns the value of attribute variations.
5 6 7 |
# File 'lib/pgn/game.rb', line 5 def variations @variations end |
Instance Method Details
#==(m) ⇒ Object
14 15 16 |
# File 'lib/pgn/game.rb', line 14 def ==(m) self.to_s == m.to_s end |
#eql?(m) ⇒ Boolean
18 19 20 |
# File 'lib/pgn/game.rb', line 18 def eql?(m) self == m end |
#hash ⇒ Object
22 23 24 |
# File 'lib/pgn/game.rb', line 22 def hash @notation.hash end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/pgn/game.rb', line 26 def to_s @notation end |