Class: Netaxept::Responses::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Response

Returns a new instance of Response.



8
9
10
11
12
13
14
15
16
# File 'lib/netaxept/responses/response.rb', line 8

def initialize(node)
  super()
  @errors = []
  if(node["Exception"])
    errors << Netaxept::ErrorMessage.new(node["Exception"]["Error"])
  elsif(node["BBSException"])
    errors << Netaxept::ErrorMessage.new(node)
  end
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/netaxept/responses/response.rb', line 6

def errors
  @errors
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/netaxept/responses/response.rb', line 18

def success?
  self.errors.empty?
end