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.



10200
10201
10202
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10200

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10198
10199
10200
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10198

def value
  @value
end

Class Method Details

.ALLObject



10220
10221
10222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10220

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



10205
10206
10207
10208
10209
10210
10211
10212
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10205

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



10236
10237
10238
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10236

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

.crossdockObject



10232
10233
10234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10232

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

.domesticObject



10228
10229
10230
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10228

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



10215
10216
10217
10218
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10215

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

.internationalObject



10224
10225
10226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10224

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

Instance Method Details

#to_hashObject



10240
10241
10242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10240

def to_hash
  value
end