Class: EcwidApi::ProductCombination

Inherits:
Entity
  • Object
show all
Defined in:
lib/ecwid_api/product_combination.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#==, #[], #assign_attributes, #assign_raw_attributes, define_accessor, #destroy!, ecwid_accessor, ecwid_reader, ecwid_writer, #marshal_dump, #marshal_load, #save, #to_hash, #to_json, #update_attributes, #update_raw_attributes, #url

Constructor Details

#initialize(data, opts = {}) ⇒ ProductCombination

Returns a new instance of ProductCombination.



14
15
16
17
# File 'lib/ecwid_api/product_combination.rb', line 14

def initialize(data, opts={})
  super(data, opts)
  @product = opts[:product]
end

Instance Attribute Details

#productObject (readonly)

Returns the value of attribute product.



3
4
5
# File 'lib/ecwid_api/product_combination.rb', line 3

def product
  @product
end

Instance Method Details

#upload_image!(filename) ⇒ Object

Public: Uploads a primary image for a ProductCombination

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



26
27
28
# File 'lib/ecwid_api/product_combination.rb', line 26

def upload_image!(filename)
  client.post_image("#{url}/image", filename)
end