class Etsy::Image
Image
¶ ↑
Represents an image resource of an Etsy
listing and contains multiple sizes. Sizes available are:
- square
-
The square image thumbnail (75x75 pixels)
- small
-
The small image thumbnail (170x135 pixels)
- thumbnail
-
The thumbnail for the image, no more than 570px wide
- full
-
The full image for this listing, no more than 1500px wide
Public Class Methods
create(listing, image_path, options = {})
click to toggle source
# File lib/etsy/image.rb, line 30 def self.create(listing, image_path, options = {}) options.merge!(:require_secure => true) options[:image] = File.new(image_path) options[:multipart] = true post("/listings/#{listing.id}/images", options) end
destroy(listing, image, options = {})
click to toggle source
Delete image
# File lib/etsy/image.rb, line 39 def self.destroy(listing, image, options = {}) options.merge!(:require_secure => true) delete("/listings/#{listing.id}/images/#{image.id}", options) end
find_all_by_listing_id(listing_id, options = {})
click to toggle source
Fetch all images for a given listing.
# File lib/etsy/image.rb, line 26 def self.find_all_by_listing_id(listing_id, options = {}) get_all("/listings/#{listing_id}/images", options) end