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.



11330
11331
11332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11330

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11328
11329
11330
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11328

def value
  @value
end

Class Method Details

.ALLObject



11350
11351
11352
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11350

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



11335
11336
11337
11338
11339
11340
11341
11342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11335

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



11366
11367
11368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11366

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

.crossdockObject



11362
11363
11364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11362

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

.domesticObject



11358
11359
11360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11358

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



11345
11346
11347
11348
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11345

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

.internationalObject



11354
11355
11356
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11354

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

Instance Method Details

#to_hashObject



11370
11371
11372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11370

def to_hash
  value
end