Class: Robots::Bed::Invalid

Inherits:
Object
  • Object
show all
Defined in:
app/models/robots/bed/invalid.rb

Overview

Generated when an unrecognised bed barcode is scanned

Instance Method Summary collapse

Constructor Details

#initialize(barcode) ⇒ Invalid

Returns a new instance of Invalid.



6
7
8
# File 'app/models/robots/bed/invalid.rb', line 6

def initialize(barcode)
  @barcode = barcode
end

Instance Method Details

#formatted_messageObject



20
21
22
23
24
25
26
# File 'app/models/robots/bed/invalid.rb', line 20

def formatted_message
  if valid_barcode?
    "Bed with barcode #{@barcode} is not expected to contain a tracked plate."
  else
    "#{@barcode} does not appear to be a valid bed barcode."
  end
end

#labelObject



16
17
18
# File 'app/models/robots/bed/invalid.rb', line 16

def label
  "Invalid bed: #{@barcode}"
end

#load(_plate_barcodes) ⇒ Object



10
# File 'app/models/robots/bed/invalid.rb', line 10

def load(_plate_barcodes); end

#plateObject



12
13
14
# File 'app/models/robots/bed/invalid.rb', line 12

def plate
  nil
end

#recognised?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/robots/bed/invalid.rb', line 28

def recognised?
  false
end

#valid?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'app/models/robots/bed/invalid.rb', line 32

def valid?
  false
end