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.



13093
13094
13095
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13093

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13091
13092
13093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13091

def value
  @value
end

Class Method Details

.ALLObject



13113
13114
13115
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13113

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



13098
13099
13100
13101
13102
13103
13104
13105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13098

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



13129
13130
13131
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13129

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

.crossdockObject



13125
13126
13127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13125

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

.domesticObject



13121
13122
13123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13121

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



13108
13109
13110
13111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13108

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

.internationalObject



13117
13118
13119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13117

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

Instance Method Details

#to_hashObject



13133
13134
13135
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13133

def to_hash
  value
end