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.



15173
15174
15175
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15173

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15171
15172
15173
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15171

def value
  @value
end

Class Method Details

.ALLObject



15193
15194
15195
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15193

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



15178
15179
15180
15181
15182
15183
15184
15185
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15178

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



15197
15198
15199
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15197

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



15188
15189
15190
15191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15188

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

.lowObject



15201
15202
15203
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15201

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

.out_of_stockObject



15205
15206
15207
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15205

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

Instance Method Details

#to_hashObject



15209
15210
15211
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15209

def to_hash
  value
end