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.



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

def initialize
  @data = []
end

Instance Attribute Details

#completed_atObject

Returns the value of attribute completed_at.



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

def completed_at
  @completed_at
end

#dataObject

Returns the value of attribute data.



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

def data
  @data
end

#passwordObject

Returns the value of attribute password.



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

def password
  @password
end

#recipientObject

Returns the value of attribute recipient.



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

def recipient
  @recipient
end

#senderObject

Returns the value of attribute sender.



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

def sender
  @sender
end

#userObject

Returns the value of attribute user.



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

def user
  @user
end

Instance Method Details

#to_aObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/mail_sandbox/message.rb', line 20

def to_a
  {
    :password => password,
    :user => user,
    :recipient => recipient,
    :sender => sender,
    :completed_at => completed_at,
    :data => data.join("\r\n"),
  }
end

#to_jsonObject



15
16
17
# File 'lib/mail_sandbox/message.rb', line 15

def to_json
  to_a.to_json
end