Forum: Ruby on Rails ActionMailer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
(Guest)
on 2007-01-06 20:30
(Received via mailing list)
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
bryanl (Guest)
on 2007-01-19 17:29
(Received via mailing list)
removed_email_address@domain.invalid wrote:
> class InfoHandler < MailHandler
>   def three
>   end
> end
>
> class NewHandler < MailHandler
>   def three
>   end
> end

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?
(Guest)
on 2007-09-26 00:30
(Received via mailing list)
Does this allow the SnazzyMixin to have access to ActionMailer?
bryanl (Guest)
on 2007-09-26 00:42
(Received via mailing list)
removed_email_address@domain.invalid wrote:
> 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"
This topic is locked and can not be replied to.