Module: PlatesHelper

Defined in:
app/helpers/plates_helper.rb

Overview

rubocop:todo Style/Documentation

Defined Under Namespace

Classes: AliquotError

Instance Method Summary collapse

Instance Method Details

#padded_wells_by_row(plate) ⇒ Object


6
7
8
9
# File 'app/helpers/plates_helper.rb', line 6

def padded_wells_by_row(plate)
  wells = wells_hash(plate)
  padded_well_name_with_index(plate) { |padded_name, index| yield(padded_name, *wells[index]) }
end

#plate_creator_parameters_json(plate_creators) ⇒ Object


17
18
19
20
21
# File 'app/helpers/plates_helper.rb', line 17

def plate_creator_parameters_json(plate_creators)
  return {}.to_json unless plate_creators

  plate_creators.each_with_object({}) { |val, memo| memo[val.name] = valid_options_for_params(val) }.to_json
end

#valid_options_for_params(val) ⇒ Object


11
12
13
14
15
# File 'app/helpers/plates_helper.rb', line 11

def valid_options_for_params(val)
  return {} unless val.valid_options

  val.valid_options.merge(valid_dilution_factors: val.valid_options[:valid_dilution_factors].map(&:to_s))
end