Class: Io::Flow::V0::Models::OrderQuoteSummaryDuty

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 = {}) ⇒ OrderQuoteSummaryDuty

Returns a new instance of OrderQuoteSummaryDuty.



49573
49574
49575
49576
49577
49578
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49573

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name, :total], 'OrderQuoteSummaryDuty')
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @total = (x = opts.delete(:total); x.is_a?(::Io::Flow::V0::Models::OrderQuotePrice) ? x : ::Io::Flow::V0::Models::OrderQuotePrice.from_json(x))
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



49571
49572
49573
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49571

def name
  @name
end

#totalObject (readonly)

Returns the value of attribute total.



49571
49572
49573
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49571

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49584
49585
49586
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49584

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

#to_hashObject



49588
49589
49590
49591
49592
49593
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49588

def to_hash
  {
    :name => name,
    :total => total.to_hash
  }
end

#to_jsonObject



49580
49581
49582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49580

def to_json
  JSON.dump(to_hash)
end