Class: FlexStationData::Sample
- Inherits:
-
Object
- Object
- FlexStationData::Sample
- Defined in:
- lib/flex_station_data/sample.rb
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#plate ⇒ Object
readonly
Returns the value of attribute plate.
-
#wells ⇒ Object
readonly
Returns the value of attribute wells.
Instance Method Summary collapse
-
#initialize(label, wells, plate) ⇒ Sample
constructor
A new instance of Sample.
- #mean ⇒ Object
- #readings ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(label, wells, plate) ⇒ Sample
Returns a new instance of Sample.
13 14 15 16 17 |
# File 'lib/flex_station_data/sample.rb', line 13 def initialize(label, wells, plate) @label = label @wells = wells @plate = plate end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
9 10 11 |
# File 'lib/flex_station_data/sample.rb', line 9 def label @label end |
#plate ⇒ Object (readonly)
Returns the value of attribute plate.
9 10 11 |
# File 'lib/flex_station_data/sample.rb', line 9 def plate @plate end |
#wells ⇒ Object (readonly)
Returns the value of attribute wells.
9 10 11 |
# File 'lib/flex_station_data/sample.rb', line 9 def wells @wells end |
Instance Method Details
#mean ⇒ Object
27 28 29 |
# File 'lib/flex_station_data/sample.rb', line 27 def mean @mean ||= values.transpose.map(&ComputeMean) end |
#readings ⇒ Object
23 24 25 |
# File 'lib/flex_station_data/sample.rb', line 23 def readings @readings ||= wells.zip(values).map { |well, v| Readings.new(well, v) } end |
#values ⇒ Object
19 20 21 |
# File 'lib/flex_station_data/sample.rb', line 19 def values wells.map(&plate_wells.method(:values)) end |