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.



10605
10606
10607
10608
10609
10610
10611
10612
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10605

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.



10603
10604
10605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10603

def destination
  @destination
end

#numberObject (readonly)

Returns the value of attribute number.



10603
10604
10605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10603

def number
  @number
end

#originObject (readonly)

Returns the value of attribute origin.



10603
10604
10605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10603

def origin
  @origin
end

#rateObject (readonly)

Returns the value of attribute rate.



10603
10604
10605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10603

def rate
  @rate
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



10618
10619
10620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10618

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

#to_hashObject



10622
10623
10624
10625
10626
10627
10628
10629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10622

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

#to_jsonObject



10614
10615
10616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10614

def to_json
  JSON.dump(to_hash)
end