Sha256: c8ddf435e5214dc26c9e66676b6158332c1fbb25a4eab621262e0c8c6ee77441

Contents?: true

Size: 536 Bytes

Versions: 2

Compression:

Stored size: 536 Bytes

Contents

module Resque
  module Mailer
    module ClassMethods

      def current_env
        RAILS_ENV
      end

      def method_missing(method_name, *args)
        return super if environment_excluded?

        case method_name.id2name
        when /^deliver_([_a-z]\w*)\!/ then super(method_name, *args)
        when /^deliver_([_a-z]\w*)/ then ::Resque.enqueue(self, "#{method_name}!", *args)
        else super(method_name, *args)
        end
      end

      def perform(cmd, *args)
        send(cmd, *args)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resque_mailer-1.0.1 lib/resque_mailer/rails2.rb
resque_mailer-1.0.0 lib/resque_mailer/rails2.rb