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.



51444
51445
51446
51447
51448
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51444

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.



51442
51443
51444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51442

def delivered_duty
  @delivered_duty
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51454
51455
51456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51454

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

#to_hashObject



51458
51459
51460
51461
51462
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51458

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

#to_jsonObject



51450
51451
51452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51450

def to_json
  JSON.dump(to_hash)
end