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.
-
#player_black ⇒ Object
readonly
Returns the value of attribute player_black.
-
#player_white ⇒ Object
readonly
Returns the value of attribute player_white.
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.
- #result ⇒ Object
- #round ⇒ Object
- #site ⇒ Object
- #values ⇒ 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 |
#player_black ⇒ Object (readonly)
Returns the value of attribute player_black.
4 5 6 |
# File 'lib/pgn/game_header.rb', line 4 def player_black @player_black end |
#player_white ⇒ Object (readonly)
Returns the value of attribute player_white.
4 5 6 |
# File 'lib/pgn/game_header.rb', line 4 def player_white @player_white 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 |
#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
50 51 52 |
# File 'lib/pgn/game_header.rb', line 50 def values @values ||= header.create_value_hash end |