Sha256: 3e4ea0c8718ce641a7275aa54a04b77d99f59692428d2e776fbfffbc81eb5d6c

Contents?: true

Size: 508 Bytes

Versions: 2

Compression:

Stored size: 508 Bytes

Contents

module LensProtocol
  module OMA
    module Types
      class Array < Type
        def parse line, next_lines
          values = parse_values line.data
          [values, next_lines]
        end

        def wrap value, _message_hash, label
          raise ValidationError, "#{label}: Expected an array of values. Got #{value}" unless value.is_a?(::Array)
          value
        end

        def format label, values
          build_line label, format_values(values)
        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/types/array.rb
lens_protocol-0.2.0 lib/lens_protocol/oma/types/array.rb