Serialize your primitives, arrays and hashes using protobuf. Supports nested arrays and hashes.
Supported types:
Inspired by google/protobuf/struct.proto
but it can additionally handle Date, Time and Integer values.
Add this line to your application's Gemfile:
gem 'protobuf_nested_struct'
And then execute:
$ bundle
Or install it yourself as:
$ gem install protobuf_nested_struct
# store the serialized binary string in DB or send over network
serialized = ProtobufNestedStruct.dump(v)
# receive de-serialized binary string from DB or network
copy = ProtobufNestedStruct.load(serialized)
expect(copy).to eql(obj)
where obj
can be an instance of one of the supported types.
You can use it to generate code for serialization and deserialization in any programming language supported by Protobuf.
bundle install
bundle exec rspec
Bug reports and pull requests are welcome on GitHub at https://github.com/arkency/protobuf-nested-struct
This repository is funded and maintained by Arkency. Check out our other open-source projects, especially Rails Event Store.
Consider hiring us to grow your Ruby/Rails apps and business. Make sure to check out our blog.