Amos_King
(Amos King)
January 4, 2007, 6:03pm
1
I would like to do something like this
class MailHandler < ActionMailer
def one
end
def two
end
end
class InfoHandler < MailHandler
def three
end
end
class NewHandler < MailHandler
def three
end
end
The problem is that with the single inheritance I can not access the
ActionMailer methods. Any one have any idea how I can do this.
Thanks,
Amos
module SnazzyMixin
def one
end
def two
end
end
class InfoHandler < AM
include SnazzyMixin
def three
end
end
class NewHandler < AM
include SnazzyMixin
def three
end
end
perhaps?
Amos_King
(Amos King)
January 4, 2007, 7:19pm
3
Does this allow the SnazzyMixin to have access to ActionMailer?
I guess I am a bit confused. If you have the following:
class A
def foo
"foo"
end
def snap
"snap"
end
end
class B < A
def bar
"bar"
end
def snap
"crackle"
end
end
a = A.new
b = B.new
a.foo # => "foo"
b.foo # => "foo"
b.bar # => "bar"
a.snap # => "snap"
b.snap # => "crackle"
Amos_King
(Amos King)
January 4, 2007, 10:44pm
5
I don't know what happened. I created a test to show, but when I ran
it it worked. I guess when I get back home I will have to look at my
code and see what I missed. This 26k connection I have at home sucks.
I moved into the middle of the country last year so I only try to ask
questions on my break at work.