class SpecialDelivery::Callback

Attributes

callback_argument[R]
callback_method[R]

Public Class Methods

method_missing(method_name, *args) click to toggle source
Calls superclass method
# File lib/special_delivery/callback.rb, line 23
def self.method_missing(method_name, *args)
  if respond_to?(method_name)
    new(method_name, *args).evaluate
  else
    super
  end
end
new(callback_method, *args) click to toggle source
# File lib/special_delivery/callback.rb, line 35
def initialize(callback_method, *args)
  @callback_method = callback_method
  @callback_argument = args[0].presence
end
respond_to?(method, include_private = false) click to toggle source
Calls superclass method
# File lib/special_delivery/callback.rb, line 19
def self.respond_to?(method, include_private = false)
  super || public_instance_methods(true).include?(method)
end

Public Instance Methods

bounced(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 3
def bounced(*args); end
clicked(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 4
def clicked(*args); end
complained(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 5
def complained(*args); end
delivered(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 6
def delivered(*args); end
dropped(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 7
def dropped(*args); end
evaluate() click to toggle source
# File lib/special_delivery/callback.rb, line 11
def evaluate
  if callback_argument.nil?
    send(callback_method)
  else
    send(callback_method, callback_argument)
  end
end
opened(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 8
def opened(*args); end
unsubscribed(*args) click to toggle source
# File lib/special_delivery/callback.rb, line 9
def unsubscribed(*args); end