Sha256: 1ed263c35da4050ec705087c42d9e9abbe0644a8c21785e742bd0f9e78fa12bf

Contents?: true

Size: 562 Bytes

Versions: 1

Compression:

Stored size: 562 Bytes

Contents

require "flex_station_data/services/value_quality"

module FlexStationData
  class SampleQuality
    include Concerns::Service

    attr_reader :sample, :value_quality_control, :options

    def initialize(sample, value_quality_control: ValueQuality, **options)
      @sample = sample
      @value_quality_control = value_quality_control
      @options = options
    end

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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flex-station-data-0.3.2 lib/flex_station_data/services/sample_quality.rb