Module: Mailgun::Tracking
- Defined in:
- lib/mailgun/tracking.rb,
lib/mailgun/tracking/auth.rb,
lib/mailgun/tracking/fanout.rb,
lib/mailgun/tracking/railtie.rb,
lib/mailgun/tracking/version.rb,
lib/mailgun/tracking/middleware.rb,
lib/mailgun/tracking/configuration.rb,
lib/generators/mailgun/tracking/install_generator.rb
Overview
The namespace for classes and modules that handle Mailgun webhooks.
Defined Under Namespace
Modules: Version Classes: Auth, Configuration, Fanout, InstallGenerator, Middleware, Railtie
Class Method Summary collapse
-
.all(callable = nil, &block) ⇒ Object
Subscribe to all events.
-
.configure {|self| ... } ⇒ Object
The default way to set up Mailgun Tracking.
-
.method_missing(method_name, *arguments, &block) ⇒ Object
Delegate any missing method call to the configuration.
-
.on(event, callable = nil, &block) ⇒ Object
Subscribe to an event.
-
.respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Replace the Object.respond_to?() method.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object (private)
Delegate any missing method call to the configuration.
80 81 82 83 84 |
# File 'lib/mailgun/tracking.rb', line 80 def method_missing(method_name, *arguments, &block) return super unless configuration.respond_to?(method_name) configuration.public_send(method_name, *arguments, &block) end |
Class Method Details
.all(callable = nil, &block) ⇒ Object
Subscribe to all events.
73 74 75 76 77 |
# File 'lib/mailgun/tracking.rb', line 73 def all(callable = nil, &block) ::Mailgun::Tracking::Fanout.all( callable || block ) end |
.configure {|self| ... } ⇒ Object
The default way to set up Mailgun Tracking.
35 36 37 |
# File 'lib/mailgun/tracking.rb', line 35 def configure yield(self) end |
.method_missing(method_name, *arguments, &block) ⇒ Object
Delegate any missing method call to the configuration.
80 81 82 83 84 |
# File 'lib/mailgun/tracking.rb', line 80 def method_missing(method_name, *arguments, &block) return super unless configuration.respond_to?(method_name) configuration.public_send(method_name, *arguments, &block) end |
.on(event, callable = nil, &block) ⇒ Object
Subscribe to an event.
53 54 55 56 57 58 |
# File 'lib/mailgun/tracking.rb', line 53 def on(event, callable = nil, &block) ::Mailgun::Tracking::Fanout.on( event.to_s.dup.freeze, callable || block ) end |
.respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Replace the Object.respond_to?() method.
87 88 89 |
# File 'lib/mailgun/tracking.rb', line 87 def respond_to_missing?(method_name, include_private = false) configuration.respond_to?(method_name) || super end |