Class: Keystone::Mail::Message
- Defined in:
- lib/keystone/mail__old/message.rb
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を使いましょう
12 13 14 15 |
# File 'lib/keystone/mail__old/message.rb', line 12 def initialize(opt={}) @subject, @body, @mail_from_text = "", "", nil set_option(opt) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
7 8 9 |
# File 'lib/keystone/mail__old/message.rb', line 7 def body @body end |
#mail_from ⇒ Object
Returns the value of attribute mail_from.
7 8 9 |
# File 'lib/keystone/mail__old/message.rb', line 7 def mail_from @mail_from end |
#mail_from_text ⇒ Object
Returns the value of attribute mail_from_text.
7 8 9 |
# File 'lib/keystone/mail__old/message.rb', line 7 def mail_from_text @mail_from_text end |
#mail_to ⇒ Object
Returns the value of attribute mail_to.
7 8 9 |
# File 'lib/keystone/mail__old/message.rb', line 7 def mail_to @mail_to end |
#subject ⇒ Object
Returns the value of attribute subject.
7 8 9 |
# File 'lib/keystone/mail__old/message.rb', line 7 def subject @subject end |
Instance Method Details
#set_option(opt) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/keystone/mail__old/message.rb', line 30 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
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/keystone/mail__old/message.rb', line 17 def to_src header = "" header += "Date: #{time2str(Time.now)}\n" header += create_mailfrom_header header += create_mailto_header header += create_subject_header header += "\n" e_body = encode_body header = header.encode(encode_body.encoding) header += e_body return header end |