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.



49711
49712
49713
49714
49715
49716
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49711

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.



49709
49710
49711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49709

def name
  @name
end

#totalObject (readonly)

Returns the value of attribute total.



49709
49710
49711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49709

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49722
49723
49724
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49722

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

#to_hashObject



49726
49727
49728
49729
49730
49731
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49726

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

#to_jsonObject



49718
49719
49720
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49718

def to_json
  JSON.dump(to_hash)
end