Module: Save
- Includes:
- Serializer
- Included in:
- Chess::Game
- Defined in:
- lib/chess/save/save.rb,
lib/chess/save/serializer.rb
Overview
Save file commands
Defined Under Namespace
Modules: Serializer
Constant Summary
Constants included from Serializer
Instance Method Summary collapse
-
#read ⇒ Hash
reads and returns saves from the save file.
-
#save ⇒ void
writes a save to the save file.
Methods included from Serializer
Instance Method Details
#read ⇒ Hash
reads and returns saves from the save file. Save::Serializer#unserialize is used to unserialize the data.
15 16 17 18 |
# File 'lib/chess/save/save.rb', line 15 def read contents = File.read('save.json') unserialize(contents) end |
#save ⇒ void
This method returns an undefined value.
writes a save to the save file
9 |
# File 'lib/chess/save/save.rb', line 9 def save; end |