Class: SportsSouth::Category
Constant Summary collapse
- API_URL =
'http://webservices.theshootingwarehouse.com/smart/inventory.asmx'
Constants inherited from Base
Base::CONTENT_TYPE, Base::TIMEOUT, Base::USER_AGENT
Class Method Summary collapse
Class Method Details
.all(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/sports_south/category.rb', line 6 def self.all( = {}) requires!(, :username, :password, :source, :customer_number) http, request = get_http_and_request(API_URL, '/CategoryUpdate') request.set_form_data(form_params()) response = http.request(request) xml_doc = Nokogiri::XML(sanitize_response(response)) raise SportsSouth::NotAuthenticated if not_authenticated?(xml_doc) xml_doc.css('Table').map { |category| map_hash(category) } end |