Files

ActionMailer::MailHelper

Public Instance Methods

attachments() click to toggle source

Access the message attachments list.

    # File lib/action_mailer/mail_helper.rb, line 37
37:     def attachments
38:       @_message.attachments
39:     end
block_format(text) click to toggle source

Uses Text::Format to take the text and format it, indented two spaces for each line, and wrapped at 72 columns.

    # File lib/action_mailer/mail_helper.rb, line 5
 5:     def block_format(text)
 6:       begin
 7:         require 'text/format'
 8:       rescue LoadError => e
 9:         $stderr.puts "You don't have text-format installed in your application. Please add it to your Gemfile and run bundle install"
10:         raise e
11:       end unless defined?(Text::Format)
12: 
13:       formatted = text.split(/\n\r\n/).collect { |paragraph|
14:         Text::Format.new(
15:           :columns => 72, :first_indent => 2, :body_indent => 2, :text => paragraph
16:         ).format
17:       }.join("\n")
18: 
19:       # Make list points stand on their own line
20:       formatted.gsub!(/[ ]*([*]+) ([^*]*)/) { |s| "  #{$1} #{$2.strip}\n" }
21:       formatted.gsub!(/[ ]*([#]+) ([^#]*)/) { |s| "  #{$1} #{$2.strip}\n" }
22: 
23:       formatted
24:     end
mailer() click to toggle source

Access the mailer instance.

    # File lib/action_mailer/mail_helper.rb, line 27
27:     def mailer
28:       @_controller
29:     end
message() click to toggle source

Access the message instance.

    # File lib/action_mailer/mail_helper.rb, line 32
32:     def message
33:       @_message
34:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.