Class: LabelPrinter::Label::SampleManifestRedirect

Inherits:
Object
  • Object
show all
Defined in:
lib/label_printer/label/sample_manifest_redirect.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ SampleManifestRedirect

Returns a new instance of SampleManifestRedirect.



7
8
9
10
11
# File 'lib/label_printer/label/sample_manifest_redirect.rb', line 7

def initialize(options)
  @sample_manifest = options[:sample_manifest]
  @printer_type_class = options[:printer_type_class]
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/label_printer/label/sample_manifest_redirect.rb', line 5

def options
  @options
end

#sample_manifestObject (readonly)

Returns the value of attribute sample_manifest.



5
6
7
# File 'lib/label_printer/label/sample_manifest_redirect.rb', line 5

def sample_manifest
  @sample_manifest
end

Instance Method Details

#labelsObject

rubocop:todo Metrics/MethodLength



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/label_printer/label/sample_manifest_redirect.rb', line 13

def labels # rubocop:todo Metrics/MethodLength
  case sample_manifest.asset_type
  when 'plate', 'library_plate'
    if @printer_type_class.double_label?
      SampleManifestPlateDouble.new(options).labels
    else
      SampleManifestPlate.new(options).labels
    end
  when '1dtube', 'library'
    SampleManifestTube.new(options).labels
  when 'multiplexed_library'
    SampleManifestMultiplex.new(options).labels
  end
end