Class: Messenger
Overview
Messengers handle passing a target into a message template for rendering warehouse messages
Instance Method Summary
collapse
convert_labware_to_receptacle_for, find_by_id_or_name, find_by_id_or_name!
Methods included from Squishify
extended
#broadcast, included, #queue_associated_for_broadcast, #queue_for_broadcast, #warren
Instance Method Details
#as_json(_options = {}) ⇒ Object
20
21
22
23
|
# File 'app/models/messenger.rb', line 20
def as_json(_options = {})
{ root => render_class.to_hash(target),
'lims' => configatron.amqp.lims_id! }
end
|
#render_class ⇒ Object
12
13
14
|
# File 'app/models/messenger.rb', line 12
def render_class
"Api::Messages::#{template}".constantize
end
|
#resend ⇒ Object
25
26
27
|
# File 'app/models/messenger.rb', line 25
def resend
broadcast
end
|
#routing_key ⇒ Object
16
17
18
|
# File 'app/models/messenger.rb', line 16
def routing_key
"#{Rails.env}.message.#{root}.#{id}"
end
|
#shoot ⇒ Object
8
9
10
|
# File 'app/models/messenger.rb', line 8
def shoot
raise StandardErrror, "Hey, don't shoot the messenger"
end
|