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



12995
12996
12997
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12995

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12993
12994
12995
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12993

def value
  @value
end

Class Method Details

.ALLObject



13015
13016
13017
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13015

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



13000
13001
13002
13003
13004
13005
13006
13007
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13000

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



13031
13032
13033
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13031

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

.crossdockObject



13027
13028
13029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13027

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

.domesticObject



13023
13024
13025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13023

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



13010
13011
13012
13013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13010

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

.internationalObject



13019
13020
13021
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13019

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

Instance Method Details

#to_hashObject



13035
13036
13037
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13035

def to_hash
  value
end