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.



53446
53447
53448
53449
53450
53451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53446

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.



53444
53445
53446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53444

def name
  @name
end

#totalObject (readonly)

Returns the value of attribute total.



53444
53445
53446
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53444

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53457
53458
53459
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53457

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

#to_hashObject



53461
53462
53463
53464
53465
53466
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53461

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

#to_jsonObject



53453
53454
53455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53453

def to_json
  JSON.dump(to_hash)
end