Class: Mailgun::Tracking::Subscriber::AllMessages

Inherits:
Object
  • Object
show all
Defined in:
lib/mailgun/tracking/subscriber/all_messages.rb

Overview

Wraps the subscriber for events.

Instance Method Summary collapse

Constructor Details

#initialize(callable) ⇒ Mailgun::Tracking::Subscriber::AllMessages

Initializes a new AllMessages object.

Parameters:

  • callable (Proc, Class)

    The callable object. The callable objects should respond to call.



12
13
14
# File 'lib/mailgun/tracking/subscriber/all_messages.rb', line 12

def initialize(callable)
  @callable = callable
end

Instance Method Details

#call(payload) ⇒ void

This method returns an undefined value.

Invokes the callable object.

Parameters:

  • payload (Hash)

    The response parameters.



21
22
23
# File 'lib/mailgun/tracking/subscriber/all_messages.rb', line 21

def call(payload)
  @callable.call(payload)
end

#subscribed_to?Boolean

Checks if a callable object is a subscribed to the specified event.

Returns:

  • (Boolean)

    Always returns true.



29
30
31
# File 'lib/mailgun/tracking/subscriber/all_messages.rb', line 29

def subscribed_to?(*)
  true
end