Created
October 5, 2016 15:40
-
-
Save yukas/6eec3ec270d73a47e0fedca1530abb18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game | |
def save_player_state | |
File.open('path/to/config.cfg', 'a') do |f| | |
f.write('player_state: near_window') | |
end | |
end | |
end | |
class Player | |
def read_state | |
@state = IO.read('path/to/config.cfg') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment