Kiwi::JSON
#
Save and load typed objects from Kiwi stores.
Kiwi::JSON delegates another Kiwi::Store and provides an interface to use Kiwi stores with classes with JSON.mapping.
Installation#
Add this to your application's shard.yml:
dependencies:
kiwi_json:
github: Schniz/kiwi_json.cr
Usage#
require "kiwi_json"
user = Person.from_json(...)
some_store = Kiwi::MemoryStore.new
json_store = Kiwi::JSON(Person).new(some_store)
json_store["user"] = user
json_store["user"] # => serialized <User:...>
Contributing#
- Fork it ( https://github.com/Schniz/kiwi_json.cr/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors#
- Schniz Gal Schlezinger - creator, maintainer