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.



17096
17097
17098
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17096

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17094
17095
17096
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17094

def value
  @value
end

Class Method Details

.ALLObject



17116
17117
17118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17116

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



17101
17102
17103
17104
17105
17106
17107
17108
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17101

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)



17166
17167
17168
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17166

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

.cifObject

Cost, Insurance & Freight (named port of destination)



17171
17172
17173
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17171

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

.cipObject

Carriage and Insurance Paid to (named place of destination)



17136
17137
17138
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17136

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

.cptObject

Carriage Paid To (named place of destination)



17131
17132
17133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17131

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

.dafObject

Delivered at Frontier (named place of delivery)



17176
17177
17178
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17176

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

.dapObject

Delivered At Place (named place of destination)



17146
17147
17148
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17146

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

.datObject

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



17141
17142
17143
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17141

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

.ddpObject

Delivered Duty Paid (named place of destination)



17151
17152
17153
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17151

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

.dduObject

Delivered Duty Unpaid (named place of destination)



17191
17192
17193
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17191

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

.deqObject

Delivered Ex Quay (named port of delivery)



17186
17187
17188
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17186

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

.desObject

Delivered Ex Ship



17181
17182
17183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17181

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

.exwObject

Ex Works (named place of delivery)



17121
17122
17123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17121

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

.fasObject

Free Alongside Ship (named port of shipment)



17156
17157
17158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17156

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

.fcaObject

Free Carrier (named place of delivery)



17126
17127
17128
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17126

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

.fobObject

Free on Board (named port of shipment)



17161
17162
17163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17161

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



17111
17112
17113
17114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17111

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



17195
17196
17197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17195

def to_hash
  value
end