Sha256: cce0187c3408a3c2b213943a7a1ae89848328d66c9d803cf501f6ac861902bb3

Contents?: true

Size: 694 Bytes

Versions: 3

Compression:

Stored size: 694 Bytes

Contents

require "active_support/core_ext"

require "flex_station_data/services/parse_plate_readings"
require "flex_station_data/services/parse_plate_samples"
require "flex_station_data/plate"

module FlexStationData
  class ParsePlate
    include Concerns::Service

    attr_reader :label, :plate_data

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

    def data_blocks
      plate_data.split { |row| row[0] == "~End" }
    end

    def call
      times, temperatures, wells = ParsePlateReadings.call(data_blocks[0])
      samples = ParsePlateSamples.call(data_blocks[1], wells)
      Plate.new(label, times, temperatures, samples)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flex-station-data-0.3.1 lib/flex_station_data/services/parse_plate.rb
flex-station-data-0.3.0 lib/flex_station_data/services/parse_plate.rb
flex-station-data-0.2.0 lib/flex_station_data/services/parse_plate.rb