Class: Io::Flow::V0::Models::DeliveredDuty

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

Returns a new instance of DeliveredDuty.



12991
12992
12993
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12991

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12989
12990
12991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12989

def value
  @value
end

Class Method Details

.ALLObject



13011
13012
13013
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13011

def DeliveredDuty.ALL
  @@all ||= [DeliveredDuty.paid, DeliveredDuty.unpaid]
end

.apply(value) ⇒ Object

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



12996
12997
12998
12999
13000
13001
13002
13003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12996

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

.from_string(value) ⇒ Object

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



13006
13007
13008
13009
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13006

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

Delivered Duty Paid (DDP). See en.wikipedia.org/wiki/Incoterms for more information



13017
13018
13019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13017

def DeliveredDuty.paid
  @@_paid ||= DeliveredDuty.new('paid')
end

.unpaidObject

Delivered Duty Unpaid (DDU). See en.wikipedia.org/wiki/Incoterms for more information



13023
13024
13025
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13023

def DeliveredDuty.unpaid
  @@_unpaid ||= DeliveredDuty.new('unpaid')
end

Instance Method Details

#to_hashObject



13027
13028
13029
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13027

def to_hash
  value
end