Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Provides an interface for storing and retreiving information in a Hash in memory
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rdebugrc
.rspec
.ruby-version
.travis.yml
Gemfile
Guardfile
LICENSE.txt
README.md
Rakefile
hashy_db.gemspec

README.md

HashyDb

Travis CI

HashyDb is a ruby in-memory hash database to provide a quick way to develop without any external database dependency in Ruby applications.

HashyDb is a database interface that abides to the Mince interface API requirements and is officially supported by Mince.

How to use it

View the Mince Wiki on details on how to use this gem.

Basically -

gem install mince hashy_db
require 'mince'
require 'hashy_db'
interface = Mince::HashyDb::Interface # => Mince::HashyDb::Interface 
interface.add 'tron_light_cycles', luminating_color: 'red', grid_locked: true, rezzed: false
interface.add 'tron_light_cycles', luminating_color: 'blue', grid_locked: true, rezzed: true
interface.find_all('tron_light_cycles') 
    # => [{:luminating_color=>"red", :grid_locked=>true, :rezzed=>false}, {:luminating_color=>"blue", :grid_locked=>true, :rezzed=>true}] 
interface.get_for_key_with_value('tron_light_cycles', :luminating_color, 'blue')
    # => {:luminating_color=>"blue", :grid_locked=>true, :rezzed=>true} 

Links

Why would you want this?

  • To defer choosing your database until you know most about your application.
  • Provides assistance in designing and developing a database agnostic application.
  • Offers very little technical dependencies. In order to develop or run the tests for your application you just need ruby installed, run bundle install and you're good to go. No need to install and start your database, migrate, etc.

Contribute

This gem is officially supported by Mince, please go there to learn how to contribute.

Something went wrong with that request. Please try again.