Class: Msgr::Consumer
Class Attribute Summary collapse
-
.auto_ack ⇒ Object
writeonly
Sets the attribute auto_ack.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Logging
Class Attribute Details
.auto_ack=(value) ⇒ Object (writeonly)
Sets the attribute auto_ack
18 19 20 |
# File 'lib/msgr/consumer.rb', line 18 def auto_ack=(value) @auto_ack = value end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/msgr/consumer.rb', line 7 def @message end |
Class Method Details
.auto_ack? ⇒ Boolean
14 15 16 |
# File 'lib/msgr/consumer.rb', line 14 def auto_ack? @auto_ack || @auto_ack.nil? end |
Instance Method Details
#dispatch(message) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/msgr/consumer.rb', line 21 def dispatch() @message = 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 |