Module: RequestType::PoolingMethod::PlateRow

Defined in:
app/models/request_type/pooling_method/plate_row.rb

Overview

Set on a multiplexed request_type Pools based on the row of the source asset. WARNING: If target assets are to be created upfront, source assets must be defined WARNING: Will pool based on source asset location, not target. So may show odd behaviour with re-arrays.

Instance Method Summary collapse

Instance Method Details

#pool_countObject



9
10
11
# File 'app/models/request_type/pooling_method/plate_row.rb', line 9

def pool_count
  pooling_options[:pool_count]
end

#pool_index_for_asset(source_asset) ⇒ Object



13
14
15
16
17
18
# File 'app/models/request_type/pooling_method/plate_row.rb', line 13

def pool_index_for_asset(source_asset)
  # This isn't ideal. We can't get the pool index until we have a source asset.
  return 0 if source_asset.blank?

  source_asset.map.row
end

#pool_index_for_request(request) ⇒ Object

Raises:

  • (StandardError)


20
21
22
23
24
25
26
# File 'app/models/request_type/pooling_method/plate_row.rb', line 20

def pool_index_for_request(request)
  return pool_index_for_asset(request.asset) if request.asset.present?

  # If we don't have an asset yet, look upstream. This assumes no
  # re-arraying has taken place.
  raise StandardError, 'Finding the pool index before requests are attached is unsupported'
end