Class: Bchess::PGN::GameHeader
- Inherits:
-
Object
- Object
- Bchess::PGN::GameHeader
- Defined in:
- lib/pgn/game_header.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
- #date ⇒ Object
- #eco ⇒ Object
- #elo_black ⇒ Object
- #elo_white ⇒ Object
- #event ⇒ Object
-
#initialize(header) ⇒ GameHeader
constructor
A new instance of GameHeader.
- #opening ⇒ Object
- #player_black ⇒ Object
- #player_white ⇒ Object
- #plycount ⇒ Object
- #result ⇒ Object
- #round ⇒ Object
- #site ⇒ Object
- #values ⇒ Object
- #variation ⇒ Object
Constructor Details
#initialize(header) ⇒ GameHeader
Returns a new instance of GameHeader.
6 7 8 |
# File 'lib/pgn/game_header.rb', line 6 def initialize(header) @header = header end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
4 5 6 |
# File 'lib/pgn/game_header.rb', line 4 def header @header end |
Instance Method Details
#date ⇒ Object
34 35 36 |
# File 'lib/pgn/game_header.rb', line 34 def date @date ||= values['Date'] end |
#eco ⇒ Object
42 43 44 |
# File 'lib/pgn/game_header.rb', line 42 def eco @eco ||= values['ECO'] end |
#elo_black ⇒ Object
22 23 24 |
# File 'lib/pgn/game_header.rb', line 22 def elo_black @elo_black ||= values['BlackElo'] end |
#elo_white ⇒ Object
18 19 20 |
# File 'lib/pgn/game_header.rb', line 18 def elo_white @elo_white ||= values['WhiteElo'] end |
#event ⇒ Object
26 27 28 |
# File 'lib/pgn/game_header.rb', line 26 def event @event ||= values['Event'] end |
#opening ⇒ Object
50 51 52 |
# File 'lib/pgn/game_header.rb', line 50 def opening @opening ||= values['Opening'] end |
#player_black ⇒ Object
14 15 16 |
# File 'lib/pgn/game_header.rb', line 14 def player_black @player_black ||= values['Black'] end |
#player_white ⇒ Object
10 11 12 |
# File 'lib/pgn/game_header.rb', line 10 def player_white @player_white ||= values['White'] end |
#plycount ⇒ Object
58 59 60 |
# File 'lib/pgn/game_header.rb', line 58 def plycount @plycount ||= values['PlyCount'] end |
#result ⇒ Object
46 47 48 |
# File 'lib/pgn/game_header.rb', line 46 def result @result ||= values['Result'] end |
#round ⇒ Object
38 39 40 |
# File 'lib/pgn/game_header.rb', line 38 def round @round ||= values['Round'] end |
#site ⇒ Object
30 31 32 |
# File 'lib/pgn/game_header.rb', line 30 def site @site ||= values['Site'] end |
#values ⇒ Object
62 63 64 |
# File 'lib/pgn/game_header.rb', line 62 def values @values ||= header.create_value_hash end |
#variation ⇒ Object
54 55 56 |
# File 'lib/pgn/game_header.rb', line 54 def variation @variation ||= values['Variation'] end |