Files

ActionMailer::DeprecatedApi::ClassMethods

Public Instance Methods

deliver(mail, show_warning=true) click to toggle source

Deliver the given mail object directly. This can be used to deliver a preconstructed mail object, like:

  email = MyMailer.create_some_mail(parameters)
  email.set_some_obscure_header "frobnicate"
  MyMailer.deliver(email)
    # File lib/action_mailer/deprecated_api.rb, line 35
35:       def deliver(mail, show_warning=true)
36:         if show_warning
37:           ActiveSupport::Deprecation.warn "#{self}.deliver is deprecated, call " <<
38:             "deliver in the mailer instance instead", caller[0,2]
39:         end
40: 
41:         raise "no mail object available for delivery!" unless mail
42:         wrap_delivery_behavior(mail)
43:         mail.deliver
44:         mail
45:       end
method_missing(method_symbol, *parameters) click to toggle source
    # File lib/action_mailer/deprecated_api.rb, line 60
60:       def method_missing(method_symbol, *parameters)
61:         if match = matches_dynamic_method?(method_symbol)
62:           case match[1]
63:             when 'create'
64:               ActiveSupport::Deprecation.warn "#{self}.create_#{match[2]} is deprecated, " <<
65:                 "use #{self}.#{match[2]} instead", caller[0,2]
66:               new(match[2], *parameters).message
67:             when 'deliver'
68:               ActiveSupport::Deprecation.warn "#{self}.deliver_#{match[2]} is deprecated, " <<
69:                 "use #{self}.#{match[2]}.deliver instead", caller[0,2]
70:               new(match[2], *parameters).message.deliver
71:             else super
72:           end
73:         else
74:           super
75:         end
76:       end
respond_to?(method_symbol, include_private = false) click to toggle source
    # File lib/action_mailer/deprecated_api.rb, line 56
56:       def respond_to?(method_symbol, include_private = false)
57:         matches_dynamic_method?(method_symbol) || super
58:       end
template_root() click to toggle source
    # File lib/action_mailer/deprecated_api.rb, line 47
47:       def template_root
48:         self.view_paths && self.view_paths.first
49:       end
template_root=(root) click to toggle source
    # File lib/action_mailer/deprecated_api.rb, line 51
51:       def template_root=(root)
52:         ActiveSupport::Deprecation.warn "template_root= is deprecated, use prepend_view_path instead", caller[0,2]
53:         self.view_paths = ActionView::Base.process_view_paths(root)
54:       end

Private Instance Methods

matches_dynamic_method?(method_name) click to toggle source
    # File lib/action_mailer/deprecated_api.rb, line 80
80:       def matches_dynamic_method?(method_name)
81:         method_name = method_name.to_s
82:         /^(create|deliver)_([_a-z]\w*)/.match(method_name) || /^(new)$/.match(method_name)
83:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.