Class: FlexStationData::SampleQuality

Inherits:
Object
  • Object
show all
Includes:
Callable
Defined in:
lib/flex_station_data/services/sample_quality.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sample, **options) ⇒ SampleQuality

Returns a new instance of SampleQuality.



11
12
13
14
# File 'lib/flex_station_data/services/sample_quality.rb', line 11

def initialize(sample, **options)
  @sample = sample
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/flex_station_data/services/sample_quality.rb', line 9

def options
  @options
end

#sampleObject (readonly)

Returns the value of attribute sample.



9
10
11
# File 'lib/flex_station_data/services/sample_quality.rb', line 9

def sample
  @sample
end

Instance Method Details

#callObject



20
21
22
# File 'lib/flex_station_data/services/sample_quality.rb', line 20

def call
  sample.values.flatten.map(&method(:value_quality)).uniq(&:to_s)
end

#value_quality(value) ⇒ Object



16
17
18
# File 'lib/flex_station_data/services/sample_quality.rb', line 16

def value_quality(value)
  ValueQuality.call(value, **options)
end