Class: LabelPrinter::Label::SampleManifestRedirect

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ SampleManifestRedirect


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

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


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

def options
  @options
end

#sample_manifestObject (readonly)

Returns the value of attribute sample_manifest


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

def sample_manifest
  @sample_manifest
end

Instance Method Details

#to_hObject


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

def to_h
  case sample_manifest.asset_type
  when 'plate'
    if @printer_type_class.double_label?
      SampleManifestPlateDouble.new(options).to_h
    else
      SampleManifestPlate.new(options).to_h
    end
  when '1dtube'
    SampleManifestTube.new(options).to_h
  when 'library'
    SampleManifestTube.new(options).to_h
  when 'multiplexed_library'
    SampleManifestMultiplex.new(options).to_h
  end
end