Class: Io::Flow::V0::Models::CenterCapability

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

Returns a new instance of CenterCapability.



10272
10273
10274
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10272

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10270
10271
10272
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10270

def value
  @value
end

Class Method Details

.ALLObject



10292
10293
10294
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10292

def CenterCapability.ALL
  @@all ||= [CenterCapability.international, CenterCapability.domestic, CenterCapability.crossdock, CenterCapability.commercial_invoice]
end

.apply(value) ⇒ Object

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



10277
10278
10279
10280
10281
10282
10283
10284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10277

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

.commercial_invoiceObject



10308
10309
10310
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10308

def CenterCapability.commercial_invoice
  @@_commercial_invoice ||= CenterCapability.new('commercial_invoice')
end

.crossdockObject



10304
10305
10306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10304

def CenterCapability.crossdock
  @@_crossdock ||= CenterCapability.new('crossdock')
end

.domesticObject



10300
10301
10302
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10300

def CenterCapability.domestic
  @@_domestic ||= CenterCapability.new('domestic')
end

.from_string(value) ⇒ Object

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



10287
10288
10289
10290
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10287

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

.internationalObject



10296
10297
10298
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10296

def CenterCapability.international
  @@_international ||= CenterCapability.new('international')
end

Instance Method Details

#to_hashObject



10312
10313
10314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10312

def to_hash
  value
end