Class: MailSandbox::Message
- Inherits:
-
Object
- Object
- MailSandbox::Message
- Defined in:
- lib/mail_sandbox/message.rb
Instance Attribute Summary collapse
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#data ⇒ Object
Returns the value of attribute data.
-
#password ⇒ Object
Returns the value of attribute password.
-
#recipients ⇒ Object
Returns the value of attribute recipients.
-
#sender ⇒ Object
Returns the value of attribute sender.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize ⇒ Message
constructor
A new instance of Message.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ Message
Returns a new instance of Message.
7 8 9 10 |
# File 'lib/mail_sandbox/message.rb', line 7 def initialize @data = [] @recipients = [] end |
Instance Attribute Details
#completed_at ⇒ Object
Returns the value of attribute completed_at.
5 6 7 |
# File 'lib/mail_sandbox/message.rb', line 5 def completed_at @completed_at end |
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/mail_sandbox/message.rb', line 5 def data @data end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/mail_sandbox/message.rb', line 5 def password @password end |
#recipients ⇒ Object
Returns the value of attribute recipients.
5 6 7 |
# File 'lib/mail_sandbox/message.rb', line 5 def recipients @recipients end |
#sender ⇒ Object
Returns the value of attribute sender.
5 6 7 |
# File 'lib/mail_sandbox/message.rb', line 5 def sender @sender end |
#user ⇒ Object
Returns the value of attribute user.
5 6 7 |
# File 'lib/mail_sandbox/message.rb', line 5 def user @user end |
Instance Method Details
#to_hash ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mail_sandbox/message.rb', line 16 def to_hash { :password => password, :user => user, :recipients => recipients.join(','), :sender => sender, :completed_at => completed_at, :data => data.join("\r\n"), } end |
#to_json ⇒ Object
12 13 14 |
# File 'lib/mail_sandbox/message.rb', line 12 def to_json to_hash.to_json end |