Sha256: 7c753c396bb82228a67256f15847dcf605b2a238f8014501b42f00f2c940b8fc

Contents?: true

Size: 434 Bytes

Versions: 4

Compression:

Stored size: 434 Bytes

Contents

module LensProtocol
  module OMA
    class Record
      attr_reader :label

      # May hold a single value, an array of values (on multi-value and chiral records), or an array of array of values (in R records for example)
      attr_reader :value

      def initialize label:, value:
        @label = label
        @value = value
      end

      def empty?
        Array(value).select(&:present?).empty?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lens_protocol-0.1.3 lib/lens_protocol/oma/record.rb
lens_protocol-0.1.2 lib/lens_protocol/oma/record.rb
lens_protocol-0.1.1 lib/lens_protocol/oma/record.rb
lens_protocol-0.1.0 lib/lens_protocol/oma/record.rb