Class: Vacuum::Response::ProductAdvertising

Inherits:
Base
  • Object
show all
Defined in:
lib/vacuum/response/product_advertising.rb

Overview

A Product Advertising API response.

Instance Attribute Summary

Attributes inherited from Base

#body, #code

Instance Method Summary collapse

Methods inherited from Base

#find, #initialize, #to_hash, #valid?, #xml

Constructor Details

This class inherits a constructor from Vacuum::Response::Base

Instance Method Details

#errorsObject

Returns an Array of errors.



6
7
8
# File 'lib/vacuum/response/product_advertising.rb', line 6

def errors
  find 'Error'
end

#has_errors?Boolean

Returns whether the response has errors.

Note that a response with errors is still technically valid, i.e. the response code is 200.

Returns:

  • (Boolean)


14
15
16
# File 'lib/vacuum/response/product_advertising.rb', line 14

def has_errors?
  errors.count > 0
end