Module: Aliquot::DeprecatedBehaviours::Request

Included in:
Request
Defined in:
app/models/aliquot/deprecated_behaviours.rb

Instance Method Summary collapse

Instance Method Details

#sample_name(default = nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/models/aliquot/deprecated_behaviours.rb', line 25

def sample_name(default = nil)
  # return the name of the underlying samples
  # used mainly for compatibility with the old codebase
  # # default is used if no smaple
  # # block is used to aggregate the samples
  case
  when samples.size == 0 then default
  when samples.size == 1 then samples.first.name
  when block_given?      then yield(samples)
  else                        samples.map(&:name).join(' | ')
  end
end

#tagObject

tags and tag have been moved to the appropriate assets. I don't think that they are used anywhere else apart from the batch xml and can therefore probably be removed.


Nope, they are used all over the place.


15
16
17
# File 'app/models/aliquot/deprecated_behaviours.rb', line 15

def tag
  target_asset.primary_aliquot.try(:tag)
end

#tag_numberObject


4
5
6
# File 'app/models/aliquot/deprecated_behaviours.rb', line 4

def tag_number
  tag.try(:map_id) || ''
end