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.



19129
19130
19131
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19129

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19127
19128
19129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19127

def value
  @value
end

Class Method Details

.ALLObject



19149
19150
19151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19149

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



19134
19135
19136
19137
19138
19139
19140
19141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19134

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)



19199
19200
19201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19199

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

.cifObject

Cost, Insurance & Freight (named port of destination)



19204
19205
19206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19204

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

.cipObject

Carriage and Insurance Paid to (named place of destination)



19169
19170
19171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19169

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

.cptObject

Carriage Paid To (named place of destination)



19164
19165
19166
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19164

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

.dafObject

Delivered at Frontier (named place of delivery)



19209
19210
19211
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19209

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

.dapObject

Delivered At Place (named place of destination)



19179
19180
19181
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19179

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

.datObject

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



19174
19175
19176
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19174

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

.ddpObject

Delivered Duty Paid (named place of destination)



19184
19185
19186
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19184

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

.dduObject

Delivered Duty Unpaid (named place of destination)



19224
19225
19226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19224

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

.deqObject

Delivered Ex Quay (named port of delivery)



19219
19220
19221
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19219

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

.desObject

Delivered Ex Ship



19214
19215
19216
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19214

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

.exwObject

Ex Works (named place of delivery)



19154
19155
19156
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19154

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

.fasObject

Free Alongside Ship (named port of shipment)



19189
19190
19191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19189

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

.fcaObject

Free Carrier (named place of delivery)



19159
19160
19161
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19159

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

.fobObject

Free on Board (named port of shipment)



19194
19195
19196
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19194

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



19144
19145
19146
19147
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19144

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



19228
19229
19230
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19228

def to_hash
  value
end