Class: Message::Message

Inherits:
Object
  • Object
show all
Includes:
DataStructureBuilder
Defined in:
app/exchanges/message/message.rb

Overview

Message::Message Creates a message in the correct structure for the warehouse

Direct Known Subclasses

VolumeTracking::MessageBuilder

Instance Method Summary collapse

Methods included from DataStructureBuilder

#data_structure, #instance_value

Instance Method Details

#contentObject

Produces the message in the correct format Example: “bmap_flowcell”=>{“sample_uuid”=>“5”, “study_uuid”=>“5”, “experiment_name”=>5, “enzyme_name”=>“Nb.BssSI”, “chip_barcode”=>“FLEVEAOLPTOWPNWU20319131581014320190911XXXXXXXXXXXXX”, “chip_serialnumber”=>“FLEVEAOLPTOWPNWU”, “position”=>2, “id_library_lims”=>5, “id_flowcell_lims”=>10, “instrument_name”=>“saphyr”, “last_updated”=>Mon, 12 Aug 2019 12:37:51 UTC +00:00}



16
17
18
19
20
# File 'app/exchanges/message/message.rb', line 16

def content
  { lims: configuration.lims }.with_indifferent_access.tap do |result|
    result[configuration.key] = data_structure
  end
end

#payloadObject

Content as json Called by the message broker



24
25
26
# File 'app/exchanges/message/message.rb', line 24

def payload
  content.to_json
end