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.



24036
24037
24038
24039
24040
24041
24042
24043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24036

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.



24034
24035
24036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24034

def destination
  @destination
end

#numberObject (readonly)

Returns the value of attribute number.



24034
24035
24036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24034

def number
  @number
end

#originObject (readonly)

Returns the value of attribute origin.



24034
24035
24036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24034

def origin
  @origin
end

#rateObject (readonly)

Returns the value of attribute rate.



24034
24035
24036
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24034

def rate
  @rate
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24049
24050
24051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24049

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

#to_hashObject



24053
24054
24055
24056
24057
24058
24059
24060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24053

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

#to_jsonObject



24045
24046
24047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24045

def to_json
  JSON.dump(to_hash)
end