How to extend ActionMailer


#1

I wish to extend ActionMailer::Base by method chaining a class instance
variable:

module ActionMailer
class Base
class << self
def method_name

What is the magic incantation to accomplish this?

I cannot get this to work with action mailer:

module MyMethods

def self.include(base)
base.alias_method_chain :method_name, :my_method

def method_name_with_my_method
… stuff
method_name_without_my_method
end

end

class ActionMailer::Base
include MyMethods
end

require ‘my_methods’


#2

James B. wrote:

I wish to extend ActionMailer::Base by method chaining a class instance
variable:

I was ever so close:

class ActionMailer::Base

class << self

def self.include(base)

   base.alias_method_chain  :method_name,  :my_method

   def method_name_with_my_method
     ...
     method_name_without_my_method
   end
end

end
end