Class: Veeqo::Product
- Includes:
- Actions::Base
- Defined in:
- lib/veeqo/product.rb
Instance Method Summary collapse
- #create(title:, variants:, images: [], **attributes) ⇒ Object
- #update(product_id, attributes) ⇒ Object
Methods included from Actions::Delete
Methods included from Actions::Find
Methods included from Actions::List
Methods inherited from Base
Instance Method Details
#create(title:, variants:, images: [], **attributes) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/veeqo/product.rb', line 5 def create(title:, variants:, images: [], **attributes) required_attributes = { title: title, product_variants_attributes: variants, images_attributes: images, } create_resource(product: required_attributes.merge(attributes)) end |
#update(product_id, attributes) ⇒ Object
15 16 17 |
# File 'lib/veeqo/product.rb', line 15 def update(product_id, attributes) update_resource(product_id, product: attributes) end |