Class: Io::Flow::V0::Models::TaxDutyQuoteFeeValue

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Value of a fee associated with customs or import.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TaxDutyQuoteFeeValue

Returns a new instance of TaxDutyQuoteFeeValue.



69966
69967
69968
69969
69970
69971
69972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69966

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:amount, :description, :amount_refundable_on_return], 'TaxDutyQuoteFeeValue')
  @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal)
  @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String)
  @amount_refundable_on_return = HttpClient::Preconditions.assert_class('amount_refundable_on_return', HttpClient::Helper.to_big_decimal(opts.delete(:amount_refundable_on_return)), BigDecimal)
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



69964
69965
69966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69964

def amount
  @amount
end

#amount_refundable_on_returnObject (readonly)

Returns the value of attribute amount_refundable_on_return.



69964
69965
69966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69964

def amount_refundable_on_return
  @amount_refundable_on_return
end

#descriptionObject (readonly)

Returns the value of attribute description.



69964
69965
69966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69964

def description
  @description
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



69978
69979
69980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69978

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

#to_hashObject



69982
69983
69984
69985
69986
69987
69988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69982

def to_hash
  {
    :amount => amount.to_f.to_s,
    :description => description,
    :amount_refundable_on_return => amount_refundable_on_return.to_f.to_s
  }
end

#to_jsonObject



69974
69975
69976
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69974

def to_json
  JSON.dump(to_hash)
end