Class: Io::Flow::V0::Models::OrderBuilderDeliveredDutyForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderBuilderDeliveredDutyForm

Returns a new instance of OrderBuilderDeliveredDutyForm.



39835
39836
39837
39838
39839
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39835

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:delivered_duty], 'OrderBuilderDeliveredDutyForm')
  @delivered_duty = (x = opts.delete(:delivered_duty); x.is_a?(::Io::Flow::V0::Models::DeliveredDuty) ? x : ::Io::Flow::V0::Models::DeliveredDuty.apply(x))
end

Instance Attribute Details

#delivered_dutyObject (readonly)

Returns the value of attribute delivered_duty.



39833
39834
39835
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39833

def delivered_duty
  @delivered_duty
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39845
39846
39847
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39845

def copy(incoming={})
  OrderBuilderDeliveredDutyForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



39849
39850
39851
39852
39853
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39849

def to_hash
  {
    :delivered_duty => delivered_duty.value
  }
end

#to_jsonObject



39841
39842
39843
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39841

def to_json
  JSON.dump(to_hash)
end