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.



21426
21427
21428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21426

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



21424
21425
21426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21424

def value
  @value
end

Class Method Details

.ALLObject



21446
21447
21448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21446

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



21431
21432
21433
21434
21435
21436
21437
21438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21431

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)



21496
21497
21498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21496

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

.cifObject

Cost, Insurance & Freight (named port of destination)



21501
21502
21503
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21501

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

.cipObject

Carriage and Insurance Paid to (named place of destination)



21466
21467
21468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21466

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

.cptObject

Carriage Paid To (named place of destination)



21461
21462
21463
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21461

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

.dafObject

Delivered at Frontier (named place of delivery)



21506
21507
21508
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21506

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

.dapObject

Delivered At Place (named place of destination)



21476
21477
21478
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21476

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

.datObject

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



21471
21472
21473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21471

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

.ddpObject

Delivered Duty Paid (named place of destination)



21481
21482
21483
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21481

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

.dduObject

Delivered Duty Unpaid (named place of destination)



21521
21522
21523
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21521

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

.deqObject

Delivered Ex Quay (named port of delivery)



21516
21517
21518
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21516

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

.desObject

Delivered Ex Ship



21511
21512
21513
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21511

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

.exwObject

Ex Works (named place of delivery)



21451
21452
21453
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21451

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

.fasObject

Free Alongside Ship (named port of shipment)



21486
21487
21488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21486

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

.fcaObject

Free Carrier (named place of delivery)



21456
21457
21458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21456

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

.fobObject

Free on Board (named port of shipment)



21491
21492
21493
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21491

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



21441
21442
21443
21444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21441

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



21525
21526
21527
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 21525

def to_hash
  value
end