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.



13126
13127
13128
13129
13130
13131
13132
13133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13126

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

#destination ⇒ Object (readonly)

Returns the value of attribute destination.



13124
13125
13126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13124

def destination
  @destination
end

#number ⇒ Object (readonly)

Returns the value of attribute number.



13124
13125
13126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13124

def number
  @number
end

#origin ⇒ Object (readonly)

Returns the value of attribute origin.



13124
13125
13126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13124

def origin
  @origin
end

#rate ⇒ Object (readonly)

Returns the value of attribute rate.



13124
13125
13126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13124

def rate
  @rate
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



13139
13140
13141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13139

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

#to_hash ⇒ Object



13143
13144
13145
13146
13147
13148
13149
13150
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13143

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

#to_json ⇒ Object



13135
13136
13137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13135

def to_json
  JSON.dump(to_hash)
end