Class: SampleManifest::LibraryTubeBehaviour::Core
Overview
Behaviour for generating a library tube
Instance Attribute Summary collapse
Instance Method Summary
collapse
#generate_sample_and_aliquot, #stocks?
#details_array, #updated_by!
#details, #generate_sanger_ids, included
Constructor Details
#initialize(manifest) ⇒ Core
Returns a new instance of Core.
15
16
17
18
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 15
def initialize(manifest)
@manifest = manifest
@tubes = []
end
|
Instance Attribute Details
#tubes ⇒ Object
Returns the value of attribute tubes.
13
14
15
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 13
def tubes
@tubes
end
|
Instance Method Details
#acceptable_purposes ⇒ Object
45
46
47
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 45
def acceptable_purposes
Purpose.none
end
|
#default_purpose ⇒ Object
#included_resources ⇒ Object
53
54
55
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 53
def included_resources
[{ sample: :sample_metadata, asset: %i[barcodes aliquots] }]
end
|
#io_samples ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 24
def io_samples
samples.map do |sample|
{
sample: sample,
container: {
barcode: sample.primary_receptacle.human_barcode
},
library_information: sample.primary_receptacle.library_information
}
end
end
|
#labware ⇒ Object
Also known as:
printables
40
41
42
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 40
def labware
tubes | labware_from_samples | @manifest.assets.map(&:labware)
end
|
#labware_from_samples ⇒ Object
36
37
38
|
# File 'app/models/sample_manifest/library_tube_behaviour.rb', line 36
def labware_from_samples
samples.map { |sample| sample.primary_receptacle.labware }
end
|