Sha256: 4720dab9c554f40a8283782e2d140d057ae52987b09c50baafbbe66b52dc109c

Contents?: true

Size: 519 Bytes

Versions: 34

Compression:

Stored size: 519 Bytes

Contents

# frozen_string_literal: true

require_relative '../api_resource'

module ErpIntegration
  module Fulfil
    module Resources
      class Product < ApiResource
        self.model_name = 'product.product'

        # Checks whether a certain product is a BOM.
        # @param sku [String] The product's SKU.
        # @return [Boolean] Whether it's a BOM or not.
        def bom?(sku)
          select(:boms).find_by!(code: sku).boms.any?
        end
        alias billing_of_materials? bom?
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
erp_integration-0.37.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.36.1 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.36.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.35.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.34.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.33.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.32.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.31.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.30.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.29.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.28.1 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.28.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.27.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.26.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.25.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.24.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.23.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.22.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.21.0 lib/erp_integration/fulfil/resources/product.rb
erp_integration-0.20.0 lib/erp_integration/fulfil/resources/product.rb