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


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

def pool_count
  pooling_options[:pool_count]
end

#pool_index_for_asset(source_asset) ⇒ Object


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

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 unless source_asset.present?

  source_asset.map.row
end

#pool_index_for_request(request) ⇒ Object

Raises:

  • (StandardError)

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

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