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