Class: LensProtocol::OMA::Record

Inherits:
Object
  • Object
show all
Defined in:
lib/lens_protocol/oma/record.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label:, value:) ⇒ Record

Returns a new instance of Record.



9
10
11
12
# File 'lib/lens_protocol/oma/record.rb', line 9

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

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



4
5
6
# File 'lib/lens_protocol/oma/record.rb', line 4

def label
  @label
end

#valueObject (readonly)

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)



7
8
9
# File 'lib/lens_protocol/oma/record.rb', line 7

def value
  @value
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/lens_protocol/oma/record.rb', line 14

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