Class: FlexStationData::ParsePlate
- Inherits:
-
Object
- Object
- FlexStationData::ParsePlate
- Includes:
- Callable
- Defined in:
- lib/flex_station_data/services/parse_plate.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#plate_data ⇒ Object
readonly
Returns the value of attribute plate_data.
Instance Method Summary collapse
- #call ⇒ Object
- #data_blocks ⇒ Object
-
#initialize(label, plate_data) ⇒ ParsePlate
constructor
A new instance of ParsePlate.
Constructor Details
#initialize(label, plate_data) ⇒ ParsePlate
Returns a new instance of ParsePlate.
15 16 17 18 |
# File 'lib/flex_station_data/services/parse_plate.rb', line 15 def initialize(label, plate_data) @label = label @plate_data = plate_data end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
13 14 15 |
# File 'lib/flex_station_data/services/parse_plate.rb', line 13 def label @label end |
#plate_data ⇒ Object (readonly)
Returns the value of attribute plate_data.
13 14 15 |
# File 'lib/flex_station_data/services/parse_plate.rb', line 13 def plate_data @plate_data end |
Instance Method Details
#call ⇒ Object
24 25 26 27 28 |
# File 'lib/flex_station_data/services/parse_plate.rb', line 24 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 |
#data_blocks ⇒ Object
20 21 22 |
# File 'lib/flex_station_data/services/parse_plate.rb', line 20 def data_blocks plate_data.split { |row| row[0] =~ /\A~End\s*\z/ } end |