Sha256: 90cad2f7b42681613575654090d1d8ad25ad575ee003d31665573196fb1c6a79

Contents?: true

Size: 525 Bytes

Versions: 57

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"

module Extension
  module Tasks
    module Converters
      module ProductConverter
        VARIANT_PATH = ["data", "products", "edges", 0, "node", "variants", "edges", 0, "node", "id"]

        def self.from_hash(hash)
          return nil if hash.nil?
          variant = hash.dig(*VARIANT_PATH)
          return unless variant
          Models::Product.new(
            variant_id: ShopifyCLI::API.gid_to_id(variant)
          )
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
shopify-cli-2.10.1 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.10.0 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.9.0 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.8.0 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.7.4 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.7.3 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.7.2 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.7.1 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.7.0 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.6 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.5 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.4 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.3 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.2 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.1 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.6.0 lib/project_types/extension/tasks/converters/product_converter.rb
shopify-cli-2.5.0 lib/project_types/extension/tasks/converters/product_converter.rb