Class: Deliverhq::Message

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Message

Returns a new instance of Message.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/deliverhq/models/message.rb', line 10

def initialize(params)
  @id = params["id"]
  @envelope_to = params["envelope_to"]
  @envelope_from = params[ "envelope_from"]
  @subject = params["subject"]
  @status = params["status"]
  @error = params["error"]
  @server_id = params[ "server_id"]
  @mailbox_id = params[ "mailbox_id"]
  @status_code = params[ "status_code"]
  @body = params[ "body"]
  @bounce_body = params[ "bounce_body"]
  @spam = params[ "spam"]
  @address_identifier = params["address_identifier"]
  @body_to = params[ "body_to"]
  @body_from = params[ "body_from"]
end

Instance Attribute Details

#address_identifierObject (readonly)

Returns the value of attribute address_identifier.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def address_identifier
  @address_identifier
end

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def body
  @body
end

#body_fromObject (readonly)

Returns the value of attribute body_from.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def body_from
  @body_from
end

#body_toObject (readonly)

Returns the value of attribute body_to.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def body_to
  @body_to
end

#bounce_bodyObject (readonly)

Returns the value of attribute bounce_body.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def bounce_body
  @bounce_body
end

#envelope_fromObject (readonly)

Returns the value of attribute envelope_from.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def envelope_from
  @envelope_from
end

#envelope_toObject (readonly)

Returns the value of attribute envelope_to.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def envelope_to
  @envelope_to
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def error
  @error
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def id
  @id
end

#mailbox_idObject (readonly)

Returns the value of attribute mailbox_id.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def mailbox_id
  @mailbox_id
end

#server_idObject (readonly)

Returns the value of attribute server_id.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def server_id
  @server_id
end

#spamObject (readonly)

Returns the value of attribute spam.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def spam
  @spam
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def status
  @status
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def status_code
  @status_code
end

#subjectObject (readonly)

Returns the value of attribute subject.



4
5
6
# File 'lib/deliverhq/models/message.rb', line 4

def subject
  @subject
end

Class Method Details

.all(page = 1) ⇒ Object



32
33
34
35
36
# File 'lib/deliverhq/models/message.rb', line 32

def self.all(page=1)
  Request::Message.list(page).collect do |message|
    new message
  end
end

.find(id) ⇒ Object



28
29
30
# File 'lib/deliverhq/models/message.rb', line 28

def self.find(id)
  new(Request::Message.show(id))
end