No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
Serialize primitives and deep structures (array, hash) to protobuf
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
>= 0
~> 10.0
~> 3.0

Runtime

 Project Readme

ProtobufNestedStruct

Serialize your primitives, arrays and hashes using protobuf. Supports nested arrays and hashes.

Supported types:

  • nil
  • integer
  • float
  • boolean
  • string
  • date
  • time
  • hash (keys must be strings, values' types must be on this list)
  • array (elements' types must be on this list)

Inspired by google/protobuf/struct.proto but it can additionally handle Date, Time and Integer values.

Installation

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

Usage

# 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.

Protobuf schema definition

You can use it to generate code for serialization and deserialization in any programming language supported by Protobuf.

Development

  • bundle install
  • bundle exec rspec

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/arkency/protobuf-nested-struct

Credits

About

Arkency

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.