Skip to content

Instantly share code, notes, and snippets.

@johncalvinyoung
Created July 30, 2012 14:10
Show Gist options
  • Save johncalvinyoung/3207142 to your computer and use it in GitHub Desktop.
Save johncalvinyoung/3207142 to your computer and use it in GitHub Desktop.
Read-write for go_fish game
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