Class: Keystone::Mail::Message
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#mail_from ⇒ Object
Returns the value of attribute mail_from.
-
#mail_from_text ⇒ Object
Returns the value of attribute mail_from_text.
-
#mail_to ⇒ Object
Returns the value of attribute mail_to.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(opt = {}) ⇒ Message
constructor
普通なことをしたいならTMailを使いましょう.
- #set_option(opt) ⇒ Object
- #to_src ⇒ Object
Constructor Details
#initialize(opt = {}) ⇒ Message
普通なことをしたいならTMailを使いましょう
11 12 13 14 |
# File 'lib/keystone/mail/message.rb', line 11 def initialize(opt={}) @subject, @body, @mail_from_text = "", "", nil set_option(opt) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/keystone/mail/message.rb', line 6 def body @body end |
#mail_from ⇒ Object
Returns the value of attribute mail_from.
6 7 8 |
# File 'lib/keystone/mail/message.rb', line 6 def mail_from @mail_from end |
#mail_from_text ⇒ Object
Returns the value of attribute mail_from_text.
6 7 8 |
# File 'lib/keystone/mail/message.rb', line 6 def mail_from_text @mail_from_text end |
#mail_to ⇒ Object
Returns the value of attribute mail_to.
6 7 8 |
# File 'lib/keystone/mail/message.rb', line 6 def mail_to @mail_to end |
#subject ⇒ Object
Returns the value of attribute subject.
6 7 8 |
# File 'lib/keystone/mail/message.rb', line 6 def subject @subject end |
Instance Method Details
#set_option(opt) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/keystone/mail/message.rb', line 27 def set_option(opt) @subject = opt[:subject] if opt.key?(:subject) @body = opt[:body] if opt.key?(:body) @body = opt[:mail_to] if opt.key?(:mail_to) @body = opt[:mail_from] if opt.key?(:mail_from) @mail_from_text = opt[:mail_from_text] if opt.key?(:mail_from_text) end |
#to_src ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/keystone/mail/message.rb', line 16 def to_src header = "" header += "Date: #{time2str(Time.now)}\n" header += create_mailfrom_header header += create_mailto_header header += create_subject_header header += "\n" header += encode_body return header end |