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.



19948
19949
19950
19951
19952
19953
19954
19955
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19948

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.



19946
19947
19948
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19946

def destination
  @destination
end

#numberObject (readonly)

Returns the value of attribute number.



19946
19947
19948
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19946

def number
  @number
end

#originObject (readonly)

Returns the value of attribute origin.



19946
19947
19948
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19946

def origin
  @origin
end

#rateObject (readonly)

Returns the value of attribute rate.



19946
19947
19948
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19946

def rate
  @rate
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



19961
19962
19963
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19961

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

#to_hashObject



19965
19966
19967
19968
19969
19970
19971
19972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19965

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

#to_jsonObject



19957
19958
19959
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19957

def to_json
  JSON.dump(to_hash)
end