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.



15840
15841
15842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15840

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15838
15839
15840
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15838

def value
  @value
end

Class Method Details

.ALLObject



15860
15861
15862
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15860

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



15845
15846
15847
15848
15849
15850
15851
15852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15845

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



15876
15877
15878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15876

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

.crossdockObject



15872
15873
15874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15872

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

.domesticObject



15868
15869
15870
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15868

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



15855
15856
15857
15858
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15855

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

.internationalObject



15864
15865
15866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15864

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

Instance Method Details

#to_hashObject



15880
15881
15882
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15880

def to_hash
  value
end