protobuf-mongoid
protobuf-mongoid is a Ruby gem that integrates Protocol Buffers with Mongoid, allowing for efficient serialization and deserialization of Mongoid documents using Protocol Buffers.
Installation
Add this line to your application's Gemfile:
gem 'protobuf-mongoid'
And then execute:
bundle install
Or install it yourself as:
gem install protobuf-mongoid
Usage
To use protobuf-mongoid, include the necessary modules in your Mongoid models. Here is a basic example:
class User
include Mongoid::Document
include Protobuf::Mongoid
field :name, type: String
field :email, type: String
# Define your Protocol Buffers message here
end
Tests
To test protobuf-mongoid, run:
rake
Contributing
- Fork it ( https://github.com/luilver/protobuf-mongoid/fork )
- Create your feature branch (git checkout -b feature/my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin feature/my-new-feature)
- Create a new Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.