class EcwidApi::Product
Public Instance Methods
combinations()
click to toggle source
# File lib/ecwid_api/product.rb, line 53 def combinations @combinations ||= Api::ProductCombinations.new(self, client) end
created()
click to toggle source
Calls superclass method
# File lib/ecwid_api/product.rb, line 57 def created @created ||= Time.parse(super) end
delete_gallery_images!()
click to toggle source
Public: Deletes all of the gallery images for a Product
Raises ResponseError
if the API returns an error
Returns a Faraday::Response object
# File lib/ecwid_api/product.rb, line 49 def delete_gallery_images! client.delete("#{url}/gallery") end
updated()
click to toggle source
Calls superclass method
# File lib/ecwid_api/product.rb, line 61 def updated @updated ||= Time.parse(super) end
upload_gallery_images!(*filenames)
click to toggle source
Public: Uploads gallery images for a Product
*filenames - Strings that are either a local file name or URL
Raises ResponseError
if the API returns an error
Returns an Array of Faraday::Response object
# File lib/ecwid_api/product.rb, line 38 def upload_gallery_images!(*filenames) filenames.map do |filename| client.post_image("#{url}/gallery", filename) end end
upload_image!(filename)
click to toggle source
Public: Uploads a primary image for a Product
filename - a String
that is either a local file name or URL
Raises ResponseError
if the API returns an error
Returns a Faraday::Response object
# File lib/ecwid_api/product.rb, line 27 def upload_image!(filename) client.post_image("#{url}/image", filename) end