Module: Sequel::Plugins::Protobuf::DatasetMethods
- Defined in:
- lib/sequel/plugins/protobuf.rb
Overview
When mixed in, this module provides the ability for Sequel datasets to call to_protobuf, which will return an array of serialized protobuf strings.
Instance Method Summary collapse
-
#to_protobuf(options = {}) ⇒ Array
Renders the current dataset of the model into a collection of protocol buffer messages as they are defined in the configured protocol buffer model definition.
Instance Method Details
#to_protobuf(options = {}) ⇒ Array
Renders the current dataset of the model into a collection of protocol buffer messages as they are defined in the configured protocol buffer model definition.
182 183 184 185 186 187 188 189 190 191 |
# File 'lib/sequel/plugins/protobuf.rb', line 182 def to_protobuf( = {}) res = self.all.inject([]) do |acc, obj| acc << obj.to_protobuf() acc end return res end |