Class: EasyMailPreview::Mailer

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_mail_preview.rb

Overview

convenience class for introspecting on an ActionMailer class

Defined Under Namespace

Classes: Method

Instance Method Summary collapse

Constructor Details

#initialize(action_mailer) ⇒ Mailer

Returns a new instance of Mailer.



14
15
16
# File 'lib/easy_mail_preview.rb', line 14

def initialize(action_mailer)
  @action_mailer = action_mailer
end

Instance Method Details

#mail_methodsObject



18
19
20
21
22
23
24
# File 'lib/easy_mail_preview.rb', line 18

def mail_methods
  (
    @action_mailer.public_instance_methods -
    @action_mailer.superclass.public_instance_methods -
    @action_mailer.included_modules.map(&:instance_methods).flatten.uniq
  ).map { |method_symbol| Method.new(@action_mailer, method_symbol) }
end

#nameObject



26
27
28
# File 'lib/easy_mail_preview.rb', line 26

def name
  @action_mailer.name
end