Module: AhoyEmail

Defined in:
lib/ahoy_email.rb,
lib/ahoy_email/utils.rb,
lib/ahoy_email/engine.rb,
lib/ahoy_email/mailer.rb,
lib/ahoy_email/tracker.rb,
lib/ahoy_email/version.rb,
lib/ahoy_email/observer.rb,
lib/ahoy_email/processor.rb,
lib/ahoy_email/redis_subscriber.rb,
lib/ahoy_email/message_subscriber.rb,
lib/ahoy_email/database_subscriber.rb

Defined Under Namespace

Modules: Mailer Classes: DatabaseSubscriber, Engine, MessageSubscriber, Observer, Processor, RedisSubscriber, Tracker, Utils

Constant Summary collapse

VERSION =
"2.3.1"

Class Method Summary collapse

Class Method Details

.message_modelObject



88
89
90
91
92
# File 'lib/ahoy_email.rb', line 88

def self.message_model
  model = defined?(@@message_model) && @@message_model
  model = model.call if model.respond_to?(:call)
  model
end

.stats(*args) ⇒ Object

shortcut for first subscriber with stats method



95
96
97
98
99
# File 'lib/ahoy_email.rb', line 95

def self.stats(*args)
  subscriber = subscribers.find { |s| s.is_a?(Class) ? s.method_defined?(:stats) : s.respond_to?(:stats) }
  subscriber = subscriber.new if subscriber.is_a?(Class)
  subscriber.stats(*args) if subscriber
end