Class: PubsubNotifier::Base
- Inherits:
-
Object
- Object
- PubsubNotifier::Base
show all
- Defined in:
- lib/pubsub_notifier/base.rb
Class Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
34
35
36
37
|
# File 'lib/pubsub_notifier/base.rb', line 34
def method_missing(method_name, *args, &block)
super unless client.respond_to?(method_name.to_sym)
client.public_send(method_name, *args, &block)
end
|
Class Method Details
.client ⇒ Object
8
9
10
|
# File 'lib/pubsub_notifier/base.rb', line 8
def client
@_client ||= clients[:logger].new
end
|
.use(name, options = {}) ⇒ Object
4
5
6
|
# File 'lib/pubsub_notifier/base.rb', line 4
def use(name, options = {})
@_client = (clients[name.to_sym] || clients[:logger]).new(options)
end
|