Module: Waffle
- Extended by:
- Waffle
- Included in:
- Waffle
- Defined in:
- lib/waffle.rb,
lib/waffle/event.rb,
lib/waffle/config.rb,
lib/waffle/version.rb,
lib/waffle/encoders/json.rb,
lib/waffle/transports/base.rb,
lib/waffle/encoders/marshal.rb,
lib/waffle/transports/redis.rb,
lib/waffle/transports/rabbitmq.rb
Defined Under Namespace
Modules: Encoders, Transports
Classes: Config, Event
Constant Summary
collapse
- VERSION =
'0.5.0'
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args) ⇒ Object
55
56
57
58
59
60
61
|
# File 'lib/waffle.rb', line 55
def method_missing meth, *args
if Config.configured?
config.queues[:default].send(meth, *args)
else
super
end
end
|
Instance Method Details
38
39
40
41
42
43
44
45
|
# File 'lib/waffle.rb', line 38
def configure options = nil, &block
if block_given?
Config.class_eval(&block)
else
options = {:path => 'config/waffle.yml'} unless options
Config.load!(options)
end
end
|
#queue(name = :default) ⇒ Object
51
52
53
|
# File 'lib/waffle.rb', line 51
def queue name = :default
config.queues[name] or raise "Transport '#{name}' is not configured"
end
|
#reset_config! ⇒ Object
34
35
36
|
# File 'lib/waffle.rb', line 34
def reset_config!
config.reset_config! if config
end
|