Class: Msgr::Consumer
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
Methods included from Logging
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/msgr/consumer.rb', line 6 def end |
Instance Method Details
#dispatch(message) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/msgr/consumer.rb', line 11 def dispatch() = action = .route.action.to_sym unless respond_to?(action) raise Msgr::NoAction.new \ "No action `#{action}` for `#{self.class.name}`." end log(:debug) { "Invoke action #{action.inspect}." } send action log(:debug) { "Action #{action.inspect} done." } end |
#publish(data, opts = {}) ⇒ Object
28 29 30 |
# File 'lib/msgr/consumer.rb', line 28 def publish(data, opts = {}) Msgr.client.publish(data, opts) end |