Sha256: e540f0de2077a4adabd1b012d6f8d195df71bd197efdece9c920befe3bad09bb

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

module Veeqo
  class Product < Base
    include Veeqo::Actions::Base

    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

    def update(product_id, attributes)
      update_resource(product_id, product: attributes)
    end

    private

    def end_point
      "products"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veeqo-0.1.1 lib/veeqo/product.rb
veeqo-0.1.0 lib/veeqo/product.rb