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.



15034
15035
15036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15034

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15032
15033
15034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15032

def value
  @value
end

Class Method Details

.ALLObject



15054
15055
15056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15054

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



15039
15040
15041
15042
15043
15044
15045
15046
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15039

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



15058
15059
15060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15058

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



15049
15050
15051
15052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15049

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

.lowObject



15062
15063
15064
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15062

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

.out_of_stockObject



15066
15067
15068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15066

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

Instance Method Details

#to_hashObject



15070
15071
15072
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15070

def to_hash
  value
end