README.md in key-vortex-0.2.2 vs README.md in key-vortex-0.2.3

- old
+ new

@@ -1,6 +1,38 @@ # KeyVortex +KeyVortex provides a common abstraction around storing records in various datastores. It allows for the use of different adapters depending on the environment, and provides constraints to protect programmatically against differing constraints between them. + +To start using KeyVortex, you'll need to define a record: + +```ruby +require "key_vortex/record" + +class ExampleRecord < KeyVortex::Record + field :a, String, length: 20 + field :b, Integer, maximum: 100 +end +``` + +Now you can use this object in various ways: + +``` +> record = ExampleRecord.new(key: "foo", a: "bar", b: 10) +=> #<ExampleRecord:0x000055fe0b5fe538 @values={:key=>"foo", :a=>"bar", :b=>10}> +> record.a +=> "bar" +> record.a = "baz" +=> "baz" +> record.a +=> "baz" +> record.b = 1000 +Invalid value 1000 for b (KeyVortex::Error) +``` + +You may notice that a `key` field was defined as well. This can be a String up to 36 characters long, to accomodate a GUID if that's what you wish to use. + + + Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/key_vortex`. To experiment with that code, run `bin/console` for an interactive prompt. TODO: Delete this and the text above, and describe your gem ## Installation