Class: NetoApiRuby::API
- Inherits:
-
Object
- Object
- NetoApiRuby::API
- Defined in:
- lib/neto_api_ruby.rb
Instance Method Summary collapse
- #create_product(attributes = {}) ⇒ Object
-
#get_products(query = {}) ⇒ Object
public methods query - A Hash with query params, insert into request body returns the request Array.
-
#initialize(url, api_key) ⇒ API
constructor
A new instance of API.
- #update_product(attributes = {}) ⇒ Object
Constructor Details
#initialize(url, api_key) ⇒ API
Returns a new instance of API.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/neto_api_ruby.rb', line 8 def initialize url, api_key #required args @neto_url = url #optional args @header_args ={ "Accept" => "application/json", "Content-Type"=> "application/json", "NETOAPI_KEY" => api_key } @body_defaults = { "IsActive"=> ["True"], "OutputSelector"=> [ "ID", "SKU", "ParentSKU", "InventoryID", "Virtual", "Name", "Brand", "Description", "Active", "Visible", "Categories", "RRP", "PromotionPrice", "PriceGroups", "DateAdded", "DateAddedLocal", "DateAddedUTC", "DateUpdated", "DateUpdatedLocal", "DateUpdatedUTC", "Group", "WarehouseQuantity", "TaxInclusive" ] } end |
Instance Method Details
#create_product(attributes = {}) ⇒ Object
53 54 55 |
# File 'lib/neto_api_ruby.rb', line 53 def create_product attributes={} do_request :post, 'AddItem', attributes end |
#get_products(query = {}) ⇒ Object
public methods query - A Hash with query params, insert into request body returns the request Array
49 50 51 |
# File 'lib/neto_api_ruby.rb', line 49 def get_products query={} do_request :post, 'GetItem', query end |
#update_product(attributes = {}) ⇒ Object
57 58 59 |
# File 'lib/neto_api_ruby.rb', line 57 def update_product attributes={} do_request :post, 'UpdateItem', attributes end |