Class: ShopifyAPI::Variant

Inherits:
Base
  • Object
show all
Includes:
DisablePrefixCheck, Metafields
Defined in:
lib/shopify_api/resources/variant.rb

Instance Method Summary collapse

Methods included from Metafields

#add_metafield, #metafields

Methods inherited from Base

activate_session, api_version, api_version=, #as_json, clear_session, early_july_pagination?, #encode, headers, init_prefix, init_prefix_explicit, #persisted?, prefix, prefix=, prefix_source, resource_prefix, resource_prefix=, version_validation!

Methods included from Countable

#count

Constructor Details

#initializeVariant

Returns a new instance of Variant.


9
10
11
12
# File 'lib/shopify_api/resources/variant.rb', line 9

def initialize(*)
  super
  attributes.except!('old_inventory_quantity')
end

Instance Method Details

#inventory_quantity=(new_value) ⇒ Object


19
20
21
22
# File 'lib/shopify_api/resources/variant.rb', line 19

def inventory_quantity=(new_value)
  raise_deprecated_inventory_call('inventory_quantity')
  super
end

#inventory_quantity_adjustment=(new_value) ⇒ Object


14
15
16
17
# File 'lib/shopify_api/resources/variant.rb', line 14

def inventory_quantity_adjustment=(new_value)
  raise_deprecated_inventory_call('inventory_quantity_adjustment')
  super
end

#old_inventory_quantity=(new_value) ⇒ Object


24
25
26
27
# File 'lib/shopify_api/resources/variant.rb', line 24

def old_inventory_quantity=(new_value)
  raise_deprecated_inventory_call('old_inventory_quantity')
  super
end

#saveObject


29
30
31
32
# File 'lib/shopify_api/resources/variant.rb', line 29

def save
  attributes.except!('inventory_quantity')
  super
end