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.



17795
17796
17797
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17795

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17793
17794
17795
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17793

def value
  @value
end

Class Method Details

.ALLObject



17815
17816
17817
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17815

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



17800
17801
17802
17803
17804
17805
17806
17807
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17800

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



17831
17832
17833
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17831

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

.crossdockObject



17827
17828
17829
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17827

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

.domesticObject



17823
17824
17825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17823

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



17810
17811
17812
17813
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17810

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

.internationalObject



17819
17820
17821
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17819

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

Instance Method Details

#to_hashObject



17835
17836
17837
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17835

def to_hash
  value
end