Class: MailSandbox::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/mail_sandbox/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMessage

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_atObject

Returns the value of attribute completed_at.



5
6
7
# File 'lib/mail_sandbox/message.rb', line 5

def completed_at
  @completed_at
end

#dataObject

Returns the value of attribute data.



5
6
7
# File 'lib/mail_sandbox/message.rb', line 5

def data
  @data
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/mail_sandbox/message.rb', line 5

def password
  @password
end

#recipientsObject

Returns the value of attribute recipients.



5
6
7
# File 'lib/mail_sandbox/message.rb', line 5

def recipients
  @recipients
end

#senderObject

Returns the value of attribute sender.



5
6
7
# File 'lib/mail_sandbox/message.rb', line 5

def sender
  @sender
end

#userObject

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_hashObject



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_jsonObject



12
13
14
# File 'lib/mail_sandbox/message.rb', line 12

def to_json
  to_hash.to_json
end