Class: Prodigi::ProductResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/prodigi/resources/products.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#default_headers, #delete_request, #get_request, #handle_response, #initialize, #patch_request, #post_request, #put_request

Constructor Details

This class inherits a constructor from Prodigi::Resource

Instance Method Details

#details(sku:) ⇒ Object



4
5
6
7
8
9
# File 'lib/prodigi/resources/products.rb', line 4

def details(sku:)
  response = get_request("products/#{sku}")
  if response.body.dig("outcome") == "Ok"
    Product.new response.body.dig("product")
  end
end