Skip to content

Instantly share code, notes, and snippets.

@linuxsable
Created October 14, 2010 01:56
Show Gist options
  • Select an option

  • Save linuxsable/625394 to your computer and use it in GitHub Desktop.

Select an option

Save linuxsable/625394 to your computer and use it in GitHub Desktop.
class DB
@@database_path = File.dirname(__FILE__) + '/../db/db.yaml'
attr_accessor :data
def initalize
load
end
def write(data)
open(@@database_path, 'w') { |f| YAML.dump(data, f) }
end
def load
@data = open(@@database_path) { |f| YAML.load(f) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment