Class: Io::Flow::V0::Models::LogisticsFormatPreference

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) ⇒ LogisticsFormatPreference

Returns a new instance of LogisticsFormatPreference.



22279
22280
22281
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22279

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22277
22278
22279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22277

def value
  @value
end

Class Method Details

.ALLObject



22299
22300
22301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22299

def LogisticsFormatPreference.ALL
  @@all ||= [LogisticsFormatPreference.shopify_console, LogisticsFormatPreference.existing_3pl_integration, LogisticsFormatPreference.byo_integration]
end

.apply(value) ⇒ Object

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



22284
22285
22286
22287
22288
22289
22290
22291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22284

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

.byo_integrationObject



22311
22312
22313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22311

def LogisticsFormatPreference.byo_integration
  @@_byo_integration ||= LogisticsFormatPreference.new('byo_integration')
end

.existing_3pl_integrationObject



22307
22308
22309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22307

def LogisticsFormatPreference.existing_3pl_integration
  @@_existing_3pl_integration ||= LogisticsFormatPreference.new('existing_3pl_integration')
end

.from_string(value) ⇒ Object

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



22294
22295
22296
22297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22294

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

.shopify_consoleObject



22303
22304
22305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22303

def LogisticsFormatPreference.shopify_console
  @@_shopify_console ||= LogisticsFormatPreference.new('shopify_console')
end

Instance Method Details

#to_hashObject



22315
22316
22317
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22315

def to_hash
  value
end