I\'m just giving my first steps in programming. I have just finished another class in Code Academy. This time I was asked to create a small movie catalog. Here is my questio
If they're simple hashes, a YAML file may be an easy way to do it.
require 'yaml'
# write hash out as a YAML file
movies = { Memento: 1, Primer: 4, Ishtar: 1 }
File.write('movies.yml', movies.to_yaml)
# read back in from file
from_file = YAML.load_file('movies.yml')
# use it
from_file[:Memento]
# => 1
from_file[:Primer]
# => 4