Class: Heron::Factories::TubeRackStatus

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/heron/factories/tube_rack_status.rb

Overview

Factory class to create Heron tube rack statuses

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#barcodeObject

Returns the value of attribute barcode.



9
10
11
# File 'app/models/heron/factories/tube_rack_status.rb', line 9

def barcode
  @barcode
end

#messagesObject

Returns the value of attribute messages.



9
10
11
# File 'app/models/heron/factories/tube_rack_status.rb', line 9

def messages
  @messages
end

#statusObject

Returns the value of attribute status.



9
10
11
# File 'app/models/heron/factories/tube_rack_status.rb', line 9

def status
  @status
end

Instance Method Details

#saveObject



15
16
17
18
19
20
# File 'app/models/heron/factories/tube_rack_status.rb', line 15

def save
  return false unless valid?

  ActiveRecord::Base.transaction { @tube_rack_status = ::TubeRackStatus.create!(barcode:, status:, messages:) }
  true
end