class SlactionMailer::Message
Public Class Methods
new(mail, options = {})
click to toggle source
Calls superclass method
# File lib/slactionmailer/message.rb, line 6 def initialize(mail, options = {}) @mail = mail @template = options.fetch(:template, self.class.template) super(@template) end
template()
click to toggle source
# File lib/slactionmailer/message.rb, line 24 def self.template "Subject: <%= @mail.subject %> From: <%= from %> To: <%= to %> <%= body %>" end
to_template(mail)
click to toggle source
# File lib/slactionmailer/message.rb, line 36 def self.to_template(mail) @mail = mail mail.to_s #"#{ @mail.subject }\nFrom: #{ @mail.from } To: #{ @mail.to }\n #{ @mail.body }" end
Public Instance Methods
body()
click to toggle source
# File lib/slactionmailer/message.rb, line 12 def body @mail.text_part.body.decoded end
from()
click to toggle source
# File lib/slactionmailer/message.rb, line 16 def from @from ||= Array(@mail['from']).join(", ") end
result()
click to toggle source
Calls superclass method
# File lib/slactionmailer/message.rb, line 32 def result super(binding) end
to()
click to toggle source
# File lib/slactionmailer/message.rb, line 20 def to @to ||= Array(@mail['to']).join(", ") end