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.



13825
13826
13827
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13825

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13823
13824
13825
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13823

def value
  @value
end

Class Method Details

.ALLObject



13845
13846
13847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13845

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



13830
13831
13832
13833
13834
13835
13836
13837
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13830

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



13861
13862
13863
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13861

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

.crossdockObject



13857
13858
13859
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13857

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

.domesticObject



13853
13854
13855
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13853

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



13840
13841
13842
13843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13840

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

.internationalObject



13849
13850
13851
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13849

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

Instance Method Details

#to_hashObject



13865
13866
13867
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13865

def to_hash
  value
end