Created
July 30, 2012 14:10
-
-
Save johncalvinyoung/3207142 to your computer and use it in GitHub Desktop.
Read-write for go_fish game
This file contains hidden or 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
def save(game) | |
File.open(game.key, 'w') do |file| | |
file.write(game.to_yaml) | |
end | |
end | |
def retrieve(game_id) | |
File.open(game_id, 'r') do |file| | |
YAML::load(file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment