Sha256: 89d3a0e5d4e31de190afeb6a26d5a0b8c5c5c30b5e60a61753cfe6beec41c1d1

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

require "active_support/core_ext"

require "flex_station_data/services/parse_plate_readings"
require "flex_station_data/services/parse_sample_map"
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] =~ /\A~End\s*\z/ }
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flex-station-data-1.0.1 lib/flex_station_data/services/parse_plate.rb
flex-station-data-1.0.0 lib/flex_station_data/services/parse_plate.rb
flex-station-data-0.3.2 lib/flex_station_data/services/parse_plate.rb