Sha256: 8aa48a0dd95e5d2073dea07b84b97312a297dd6326af49df9d5b9790937cde5b

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

# frozen_string_literal: true

module ActiveDelivery
  module Lines
    class Mailer < Base
      alias mailer_class handler_class

      def resolve_class(name)
        name.gsub(/Delivery$/, "Mailer").safe_constantize
      end

      def notify?(method_name)
        mailer_class.action_methods.include?(method_name.to_s)
      end

      def notify_now(mailer, mid, *args)
        mailer.public_send(mid, *args).deliver_now
      end

      def notify_later(mailer, mid, *args)
        mailer.public_send(mid, *args).deliver_later
      end
    end

    ActiveDelivery::Base.register_line :mailer, Mailer
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_delivery-0.2.0 lib/active_delivery/lines/mailer.rb