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.4.0"

Class Method Summary collapse

Class Method Details

.message_modelObject



91
92
93
94
95
# File 'lib/ahoy_email.rb', line 91

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



98
99
100
101
102
# File 'lib/ahoy_email.rb', line 98

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