Class: EcwidApi::ProductCombination
- Defined in:
- lib/ecwid_api/product_combination.rb
Instance Attribute Summary collapse
-
#product ⇒ Object
readonly
Returns the value of attribute product.
Instance Method Summary collapse
-
#initialize(data, opts = {}) ⇒ ProductCombination
constructor
A new instance of ProductCombination.
-
#upload_image!(filename) ⇒ Object
Public: Uploads a primary image for a ProductCombination.
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
#product ⇒ Object (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 |