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.



10743
10744
10745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10743

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10741
10742
10743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10741

def value
  @value
end

Class Method Details

.ALLObject



10763
10764
10765
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10763

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



10748
10749
10750
10751
10752
10753
10754
10755
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10748

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



10779
10780
10781
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10779

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

.crossdockObject



10775
10776
10777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10775

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

.domesticObject



10771
10772
10773
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10771

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



10758
10759
10760
10761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10758

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

.internationalObject



10767
10768
10769
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10767

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

Instance Method Details

#to_hashObject



10783
10784
10785
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10783

def to_hash
  value
end