lib/resque_bus/dispatch.rb in resque-bus-0.2.4 vs lib/resque_bus/dispatch.rb in resque-bus-0.2.5
- old
+ new
@@ -1,10 +1,12 @@
# Creates a DSL for apps to define their blocks to run for event_types
module ResqueBus
class Dispatch
+
attr_reader :app_key, :subscriptions
+
def initialize(app_key)
@app_key = Application.normalize(app_key)
@subscriptions = SubscriptionList.new
end
@@ -16,12 +18,12 @@
dispatch_event("default", key, matcher_hash, block)
end
# allows definitions of other queues
def method_missing(method_name, *args, &block)
- if args.size == 1 and block
+ if args.size == 1 && block
dispatch_event(method_name, args[0], nil, block)
- elsif args.size == 2 and block
+ elsif args.size == 2 && block
dispatch_event(method_name, args[0], args[1], block)
else
super
end
end