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.



15585
15586
15587
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15585

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15583
15584
15585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15583

def value
  @value
end

Class Method Details

.ALLObject



15605
15606
15607
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15605

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



15590
15591
15592
15593
15594
15595
15596
15597
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15590

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



15609
15610
15611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15609

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



15600
15601
15602
15603
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15600

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

.lowObject



15613
15614
15615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15613

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

.out_of_stockObject



15617
15618
15619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15617

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

Instance Method Details

#to_hashObject



15621
15622
15623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15621

def to_hash
  value
end