kiwi_json.cr

Save and load typed objects from Kiwi stores

Kiwi::JSON build status

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

  1. Fork it ( https://github.com/Schniz/kiwi_json.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Schniz Gal Schlezinger - creator, maintainer
Repository

kiwi_json.cr

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 2
  • about 7 years ago
  • October 21, 2017
License

MIT License

Links
Synced at

Mon, 18 Nov 2024 03:34:53 GMT

Languages