Class: Io::Flow::V0::Models::ShopifyVariantInventoryMetafieldStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ShopifyVariantInventoryMetafieldStatus

Returns a new instance of ShopifyVariantInventoryMetafieldStatus.



15106
15107
15108
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15106

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15104
15105
15106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15104

def value
  @value
end

Class Method Details

.ALLObject



15126
15127
15128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15126

def ShopifyVariantInventoryMetafieldStatus.ALL
  @@all ||= [ShopifyVariantInventoryMetafieldStatus.available, ShopifyVariantInventoryMetafieldStatus.low, ShopifyVariantInventoryMetafieldStatus.out_of_stock]
end

.apply(value) ⇒ Object

Returns the instance of ShopifyVariantInventoryMetafieldStatus for this value, creating a new instance for an unknown value



15111
15112
15113
15114
15115
15116
15117
15118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15111

def ShopifyVariantInventoryMetafieldStatus.apply(value)
  if value.instance_of?(ShopifyVariantInventoryMetafieldStatus)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ShopifyVariantInventoryMetafieldStatus.new(value))
  end
end

.availableObject



15130
15131
15132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15130

def ShopifyVariantInventoryMetafieldStatus.available
  @@_available ||= ShopifyVariantInventoryMetafieldStatus.new('available')
end

.from_string(value) ⇒ Object

Returns the instance of ShopifyVariantInventoryMetafieldStatus for this value, or nil if not found



15121
15122
15123
15124
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15121

def ShopifyVariantInventoryMetafieldStatus.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ShopifyVariantInventoryMetafieldStatus.ALL.find { |v| v.value == value }
end

.lowObject



15134
15135
15136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15134

def ShopifyVariantInventoryMetafieldStatus.low
  @@_low ||= ShopifyVariantInventoryMetafieldStatus.new('low')
end

.out_of_stockObject



15138
15139
15140
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15138

def ShopifyVariantInventoryMetafieldStatus.out_of_stock
  @@_out_of_stock ||= ShopifyVariantInventoryMetafieldStatus.new('out_of_stock')
end

Instance Method Details

#to_hashObject



15142
15143
15144
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15142

def to_hash
  value
end