Module: Sdb::SampleManifestsHelper

Defined in:
app/helpers/sdb/sample_manifests_helper.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#count_barcode_heading_for(asset_type) ⇒ Object


38
39
40
41
42
43
44
# File 'app/helpers/sdb/sample_manifests_helper.rb', line 38

def count_barcode_heading_for(asset_type)
  if asset_type == 'tube_rack'
    'Tube Racks'
  else
    'Barcodes'
  end
end

#count_label_for(asset_type) ⇒ String

TODO:

Switch to just using I18n

Returns suitable label text for the sample manifest count field

Parameters:

  • asset_type (String)

    The asset_type / behaviour eg. '1dtube'

Returns:

  • (String)

    Suitable label text


18
19
20
# File 'app/helpers/sdb/sample_manifests_helper.rb', line 18

def count_label_for(asset_type)
  count_labels.fetch(asset_type, 'Count')
end

#count_labelsObject


2
3
4
5
6
7
8
9
10
# File 'app/helpers/sdb/sample_manifests_helper.rb', line 2

def count_labels
  {
    '1dtube' => 'Tubes required',
    'plate' => 'Plates required',
    'library' => 'Tubes required',
    'multiplexed_library' => 'Number of samples in library',
    'tube_rack' => 'Tube racks required'
  }
end

#purpose_label_for(asset_type) ⇒ Object


30
31
32
33
34
35
36
# File 'app/helpers/sdb/sample_manifests_helper.rb', line 30

def purpose_label_for(asset_type)
  if asset_type == 'tube_rack'
    'Tube purpose'
  else
    'Purpose'
  end
end

#submit_label_for(asset_type) ⇒ Object


22
23
24
25
26
27
28
# File 'app/helpers/sdb/sample_manifests_helper.rb', line 22

def submit_label_for(asset_type)
  if asset_type == 'tube_rack'
    'Create manifest'
  else
    'Create manifest and print labels'
  end
end