Class: Io::Flow::V0::Models::OrderQuoteSummaryTax

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

Returns a new instance of OrderQuoteSummaryTax.



53584
53585
53586
53587
53588
53589
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53584

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name, :total], 'OrderQuoteSummaryTax')
  @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.



53582
53583
53584
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53582

def name
  @name
end

#totalObject (readonly)

Returns the value of attribute total.



53582
53583
53584
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53582

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53595
53596
53597
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53595

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

#to_hashObject



53599
53600
53601
53602
53603
53604
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53599

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

#to_jsonObject



53591
53592
53593
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53591

def to_json
  JSON.dump(to_hash)
end