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.



12392
12393
12394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12392

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12390
12391
12392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12390

def value
  @value
end

Class Method Details

.ALLObject



12412
12413
12414
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12412

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



12397
12398
12399
12400
12401
12402
12403
12404
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12397

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



12428
12429
12430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12428

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

.crossdockObject



12424
12425
12426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12424

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

.domesticObject



12420
12421
12422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12420

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



12407
12408
12409
12410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12407

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

.internationalObject



12416
12417
12418
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12416

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

Instance Method Details

#to_hashObject



12432
12433
12434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12432

def to_hash
  value
end