Class: NeomodeClient::Api

Inherits:
Object
  • Object
show all
Includes:
NeomodeClient
Defined in:
lib/neomode_client/api.rb

Instance Method Summary collapse

Methods included from NeomodeClient

#handler, #mount_url

Constructor Details

#initialize(args) ⇒ Api

Returns a new instance of Api.



5
6
7
8
# File 'lib/neomode_client/api.rb', line 5

def initialize(args)
  @token = args[:token]
  @is_production = args[:is_production]
end

Instance Method Details

#send_products(body) ⇒ Object



10
11
12
13
14
# File 'lib/neomode_client/api.rb', line 10

def send_products(body)
  response = connection.put("/management/catalog/products", body.to_json)

  handler.new(response).parse!
end

#update_price(body) ⇒ Object



22
23
24
25
26
# File 'lib/neomode_client/api.rb', line 22

def update_price(body)
  response = connection.put("/management/catalog/prices", body.to_json)

  handler.new(response).parse!
end

#update_quantity(body) ⇒ Object



16
17
18
19
20
# File 'lib/neomode_client/api.rb', line 16

def update_quantity(body)
  response = connection.put("/management/catalog/stocks", body.to_json)

  handler.new(response).parse!
end