Class: Io::Flow::V0::Models::HarmonizedItemDutyForm

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 = {}) ⇒ HarmonizedItemDutyForm

Returns a new instance of HarmonizedItemDutyForm.



17386
17387
17388
17389
17390
17391
17392
17393
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17386

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:number, :origin, :destination, :rate], 'HarmonizedItemDutyForm')
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @origin = HttpClient::Preconditions.assert_class('origin', opts.delete(:origin), String)
  @destination = HttpClient::Preconditions.assert_class('destination', opts.delete(:destination), String)
  @rate = HttpClient::Preconditions.assert_class('rate', HttpClient::Helper.to_big_decimal(opts.delete(:rate)), BigDecimal)
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



17384
17385
17386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17384

def destination
  @destination
end

#numberObject (readonly)

Returns the value of attribute number.



17384
17385
17386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17384

def number
  @number
end

#originObject (readonly)

Returns the value of attribute origin.



17384
17385
17386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17384

def origin
  @origin
end

#rateObject (readonly)

Returns the value of attribute rate.



17384
17385
17386
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17384

def rate
  @rate
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



17399
17400
17401
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17399

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

#to_hashObject



17403
17404
17405
17406
17407
17408
17409
17410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17403

def to_hash
  {
    :number => number,
    :origin => origin,
    :destination => destination,
    :rate => rate
  }
end

#to_jsonObject



17395
17396
17397
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17395

def to_json
  JSON.dump(to_hash)
end