Class: Io::Flow::V0::Models::Incoterm

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) ⇒ Incoterm

Returns a new instance of Incoterm.



15252
15253
15254
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15252

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15250
15251
15252
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15250

def value
  @value
end

Class Method Details

.ALLObject



15272
15273
15274
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15272

def Incoterm.ALL
  @@all ||= [Incoterm.exw, Incoterm.fca, Incoterm.cpt, Incoterm.cip, Incoterm.dat, Incoterm.dap, Incoterm.ddp, Incoterm.fas, Incoterm.fob, Incoterm.cfr, Incoterm.cif, Incoterm.daf, Incoterm.des, Incoterm.deq, Incoterm.ddu]
end

.apply(value) ⇒ Object

Returns the instance of Incoterm for this value, creating a new instance for an unknown value



15257
15258
15259
15260
15261
15262
15263
15264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15257

def Incoterm.apply(value)
  if value.instance_of?(Incoterm)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || Incoterm.new(value))
  end
end

.cfrObject

Cost and Freight (named port of destination)



15322
15323
15324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15322

def Incoterm.cfr
  @@_cfr ||= Incoterm.new('CFR')
end

.cifObject

Cost, Insurance & Freight (named port of destination)



15327
15328
15329
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15327

def Incoterm.cif
  @@_cif ||= Incoterm.new('CIF')
end

.cipObject

Carriage and Insurance Paid to (named place of destination)



15292
15293
15294
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15292

def Incoterm.cip
  @@_cip ||= Incoterm.new('CIP')
end

.cptObject

Carriage Paid To (named place of destination)



15287
15288
15289
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15287

def Incoterm.cpt
  @@_cpt ||= Incoterm.new('CPT')
end

.dafObject

Delivered at Frontier (named place of delivery)



15332
15333
15334
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15332

def Incoterm.daf
  @@_daf ||= Incoterm.new('DAF')
end

.dapObject

Delivered At Place (named place of destination)



15302
15303
15304
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15302

def Incoterm.dap
  @@_dap ||= Incoterm.new('DAP')
end

.datObject

Delivered At Terminal (named terminal at port or place of destination)



15297
15298
15299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15297

def Incoterm.dat
  @@_dat ||= Incoterm.new('DAT')
end

.ddpObject

Delivered Duty Paid (named place of destination)



15307
15308
15309
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15307

def Incoterm.ddp
  @@_ddp ||= Incoterm.new('DDP')
end

.dduObject

Delivered Duty Unpaid (named place of destination)



15347
15348
15349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15347

def Incoterm.ddu
  @@_ddu ||= Incoterm.new('DDU')
end

.deqObject

Delivered Ex Quay (named port of delivery)



15342
15343
15344
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15342

def Incoterm.deq
  @@_deq ||= Incoterm.new('DEQ')
end

.desObject

Delivered Ex Ship



15337
15338
15339
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15337

def Incoterm.des
  @@_des ||= Incoterm.new('DES')
end

.exwObject

Ex Works (named place of delivery)



15277
15278
15279
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15277

def Incoterm.exw
  @@_exw ||= Incoterm.new('EXW')
end

.fasObject

Free Alongside Ship (named port of shipment)



15312
15313
15314
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15312

def Incoterm.fas
  @@_fas ||= Incoterm.new('FAS')
end

.fcaObject

Free Carrier (named place of delivery)



15282
15283
15284
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15282

def Incoterm.fca
  @@_fca ||= Incoterm.new('FCA')
end

.fobObject

Free on Board (named port of shipment)



15317
15318
15319
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15317

def Incoterm.fob
  @@_fob ||= Incoterm.new('FOB')
end

.from_string(value) ⇒ Object

Returns the instance of Incoterm for this value, or nil if not found



15267
15268
15269
15270
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15267

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

Instance Method Details

#to_hashObject



15351
15352
15353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15351

def to_hash
  value
end