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.



13731
13732
13733
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13731

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13729
13730
13731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13729

def value
  @value
end

Class Method Details

.ALLObject



13751
13752
13753
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13751

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



13736
13737
13738
13739
13740
13741
13742
13743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13736

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



13767
13768
13769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13767

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

.crossdockObject



13763
13764
13765
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13763

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

.domesticObject



13759
13760
13761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13759

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



13746
13747
13748
13749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13746

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

.internationalObject



13755
13756
13757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13755

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

Instance Method Details

#to_hashObject



13771
13772
13773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13771

def to_hash
  value
end