Class: OpenMarket::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Response

Returns a new instance of Response.



6
7
8
9
10
11
12
13
14
# File 'lib/open_market/response.rb', line 6

def initialize(xml)
  @doc = REXML::Document.new(xml)
  puts xml
  
  get_error
  get_destination
  get_location
  get_operator
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



4
5
6
# File 'lib/open_market/response.rb', line 4

def destination
  @destination
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/open_market/response.rb', line 4

def error
  @error
end

#locationObject (readonly)

Returns the value of attribute location.



4
5
6
# File 'lib/open_market/response.rb', line 4

def location
  @location
end

#operatorObject (readonly)

Returns the value of attribute operator.



4
5
6
# File 'lib/open_market/response.rb', line 4

def operator
  @operator
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/open_market/response.rb', line 16

def success?
  @error && @error[:code] == 0
end