Sha256: fa35024e3be35398509d0f0e87ccaef39e41150cf5299085f575757b0547e1d6

Contents?: true

Size: 342 Bytes

Versions: 5

Compression:

Stored size: 342 Bytes

Contents

require "flex_station_data/services/compute_mean"

module FlexStationData
  class Readings
    attr_reader :label, :values

    def initialize(label, values)
      @label = label
      @values = values
    end

    def self.mean(*readings, label: "mean")
      new(label, readings.map(&:values).transpose.map(&ComputeMean))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
flex-station-data-0.3.1 lib/flex_station_data/readings.rb
flex-station-data-0.3.0 lib/flex_station_data/readings.rb
flex-station-data-0.2.0 lib/flex_station_data/readings.rb
flex-station-data-0.1.1 lib/flex_station_data/readings.rb
flex-station-data-0.1.0 lib/flex_station_data/readings.rb