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.



14156
14157
14158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14156

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14154
14155
14156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14154

def value
  @value
end

Class Method Details

.ALLObject



14176
14177
14178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14176

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



14161
14162
14163
14164
14165
14166
14167
14168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14161

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



14192
14193
14194
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14192

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

.crossdockObject



14188
14189
14190
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14188

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

.domesticObject



14184
14185
14186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14184

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



14171
14172
14173
14174
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14171

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

.internationalObject



14180
14181
14182
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14180

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

Instance Method Details

#to_hashObject



14196
14197
14198
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14196

def to_hash
  value
end