Skip to content

Instantly share code, notes, and snippets.

@chelseatroy
Created May 23, 2019 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chelseatroy/f22966e8622cd1d6b5787efddcc08230 to your computer and use it in GitHub Desktop.
Save chelseatroy/f22966e8622cd1d6b5787efddcc08230 to your computer and use it in GitHub Desktop.
Initial Database
class Database
def initialize
@db = Hash.new()
end
# CRUD COMMANDS
def set(key, value)
@db[key] = value
return nil
end
def get(key)
@db.fetch(key, "NULL")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment