Skip to content

jjoos/korsakov

Repository files navigation

Korsakov Build Status Gem Version Dependency Status Code Climate Coverage Status

Gem that provides entities for ruby..

Use at your own risk, this is EXTREMELY alpha and subject to changes without notice.

Installation

Add this line to your application's Gemfile:

gem 'korsakov'

And then execute:

$ bundle

Or install it yourself as:

$ gem install korsakov

Entities

TODO

Immutable entities

These objects can be used to simplify your design by making sure your object is always valid.

Usage

class User < Korsakov::Entity
  attributes :name, :username, :email
end

my_entity = User.new do
  self.name = 'jan'
  self.username = 'jjoos'
  self.email = 'jan@deelstra.org'
end

or

my_entity = User.new({name: 'jan', username: 'jjoos', email: 'jan@deelstra.org'})

my_entity = my_entity.update({name: 'joop', email: 'joop@deelstra.org'})

puts my_entity.username

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Run bundle, before starting development.
  4. Implement your feature/bugfix and corresponding tests.
  5. Make sure your tests run against the latest stable mri.
  6. Commit your changes (git commit -am 'Add some feature')
  7. Push to the branch (git push origin my-new-feature)
  8. Create new Pull Request

About

Providing rails models that are compatible with Pavlov.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages