Module: ActiveNotifier::Transports

Extended by:
ActiveSupport::Autoload
Defined in:
lib/active_notifier/transports.rb,
lib/active_notifier/transports/pushmeup.rb,
lib/active_notifier/transports/action_mailer.rb

Defined Under Namespace

Classes: ActionMailer, Pushmeup

Class Method Summary collapse

Class Method Details

.for(channel, configuration, notifier) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/active_notifier/transports.rb', line 8

def self.for(channel, configuration, notifier)
  transport_klass = self.constants.map do |klass_name|
    self.const_get(klass_name)
  end.detect do |klass|
    klass.channel == channel
  end || fail("No transport defined for channel '#{channel}'")

  transport_klass.new(configuration, notifier)
end