README.md in memory_model-0.1.0 vs README.md in memory_model-1.0.0

- old
+ new

@@ -1,15 +1,14 @@ -[![Version](http://allthebadges.io/jwaldrip/memory_model/badge_fury.png)](http://allthebadges.io/jwaldrip/memory_model/badge_fury) -[![Dependencies](http://allthebadges.io/jwaldrip/memory_model/gemnasium.png)](http://allthebadges.io/jwaldrip/memory_model/gemnasium) -[![Build Status](http://allthebadges.io/jwaldrip/memory_model/travis.png)](http://allthebadges.io/jwaldrip/memory_model/travis) -[![Coverage](http://allthebadges.io/jwaldrip/memory_model/coveralls.png)](http://allthebadges.io/jwaldrip/memory_model/coveralls) -[![Code Climate](http://allthebadges.io/jwaldrip/memory_model/code_climate.png)](http://allthebadges.io/jwaldrip/memory_model/code_climate) - # MemoryModel -TODO: Write a gem description +[![Gem Version](https://badge.fury.io/rb/memory_model.svg)](https://badge.fury.io/rb/jsonapionify) +[![Build Status](https://travis-ci.org/jwaldrip/memory_model.svg?branch=master)](https://travis-ci.org/brandfolder/jsonapionify) +[![Code Climate](https://codeclimate.com/github/jwaldrip/memory_model/badges/gpa.svg)](https://codeclimate.com/github/jwaldrip/memory_model) +[![Test Coverage](https://codeclimate.com/github/jwaldrip/memory_model/badges/coverage.svg)](https://codeclimate.com/github/jwaldrip/memory_model/coverage) +An in memory model construct. Good for testing. + ## Installation Add this line to your application's Gemfile: gem 'memory_model' @@ -22,10 +21,47 @@ $ gem install memory_model ## Usage -TODO: Write usage instructions here +### Creating a basic model + +```ruby +class User < MemoryModel::Base + primary_key :id + + field :first_name + field :last_name +end +``` + +### Creating Records + +```ruby +User.create(first_name: 'jason') + +# OR + +User.new(first_name: 'jason').save +``` + +### Finding Records + +```ruby +User.find(id) +``` + +### Updating Records + +```ruby +User.find(id).update(first_name: 'larry') +``` + +### Deleting Records + +```ruby +User.find(id).delete +``` ## Contributing 1. Fork it 2. Create your feature branch (`git checkout -b my-new-feature`)