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.



13726
13727
13728
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13726

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13724
13725
13726
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13724

def value
  @value
end

Class Method Details

.ALLObject



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

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



13731
13732
13733
13734
13735
13736
13737
13738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13731

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



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

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

.crossdockObject



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

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

.domesticObject



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

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



13741
13742
13743
13744
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13741

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

.internationalObject



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

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

Instance Method Details

#to_hashObject



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

def to_hash
  value
end