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.



37353
37354
37355
37356
37357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37353

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.



37351
37352
37353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37351

def delivered_duty
  @delivered_duty
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37363
37364
37365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37363

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

#to_hashObject



37367
37368
37369
37370
37371
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37367

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

#to_jsonObject



37359
37360
37361
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37359

def to_json
  JSON.dump(to_hash)
end