Sha256: 1718c22e40c882ffab6b14cddc2206b56d890aa86c1d7b9c94f044102bca5ff4

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

module LensProtocol
  module OMA
    class Builder
      def build hash, types: {}
        types = TYPES.merge(types)

        hash.reduce Message.new do |message, (label, value)|
          wrapped_value = types[label].wrap(value, hash, label)
          if wrapped_value == :ignored
            message
          else
            message.add_record(label, wrapped_value)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lens_protocol-0.2.1 lib/lens_protocol/oma/builder.rb
lens_protocol-0.2.0 lib/lens_protocol/oma/builder.rb