Class: EmailDirect::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/email_direct/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Response

Returns a new instance of Response.



5
6
7
8
# File 'lib/email_direct/response.rb', line 5

def initialize(xml)
  @xml = xml
  parse_response!
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/email_direct/response.rb', line 3

def code
  @code
end

#dataObject (readonly)

Returns the value of attribute data.



3
4
5
# File 'lib/email_direct/response.rb', line 3

def data
  @data
end

#messageObject (readonly)

Returns the value of attribute message.



3
4
5
# File 'lib/email_direct/response.rb', line 3

def message
  @message
end

#xmlObject (readonly)

Returns the value of attribute xml.



3
4
5
# File 'lib/email_direct/response.rb', line 3

def xml
  @xml
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/email_direct/response.rb', line 10

def success?
  @code == 0
end