Class: Bchess::PGN::PGNFile
- Inherits:
-
Object
- Object
- Bchess::PGN::PGNFile
- Defined in:
- lib/pgn/pgn_file.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#filepath ⇒ Object
Returns the value of attribute filepath.
-
#games ⇒ Object
Returns the value of attribute games.
Instance Method Summary collapse
-
#initialize(filepath) ⇒ PGNFile
constructor
A new instance of PGNFile.
- #load_games ⇒ Object
Constructor Details
#initialize(filepath) ⇒ PGNFile
Returns a new instance of PGNFile.
6 7 8 |
# File 'lib/pgn/pgn_file.rb', line 6 def initialize(filepath) @filepath = filepath end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4 5 6 |
# File 'lib/pgn/pgn_file.rb', line 4 def content @content end |
#filepath ⇒ Object
Returns the value of attribute filepath.
4 5 6 |
# File 'lib/pgn/pgn_file.rb', line 4 def filepath @filepath end |
#games ⇒ Object
Returns the value of attribute games.
4 5 6 |
# File 'lib/pgn/pgn_file.rb', line 4 def games @games end |
Instance Method Details
#load_games ⇒ Object
10 11 12 13 |
# File 'lib/pgn/pgn_file.rb', line 10 def load_games file = File.open(filepath, 'rt') @content = file.read end |