Class: Shopify::DefaultVariant::Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/shopify/default_variant.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Hash

Returns a new instance of Hash.



39
40
41
# File 'lib/shopify/default_variant.rb', line 39

def initialize(hash)
  @hash = hash
end

Instance Method Details

#match?Boolean

Returns:

  • (Boolean)


43
44
45
46
47
# File 'lib/shopify/default_variant.rb', line 43

def match?
  return false unless @hash.is_a?(::Hash)

  plain_hash_match? || graphql_hash_match?
end