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.



47611
47612
47613
47614
47615
47616
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47611

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.



47609
47610
47611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47609

def name
  @name
end

#totalObject (readonly)

Returns the value of attribute total.



47609
47610
47611
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47609

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47622
47623
47624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47622

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

#to_hashObject



47626
47627
47628
47629
47630
47631
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47626

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

#to_jsonObject



47618
47619
47620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47618

def to_json
  JSON.dump(to_hash)
end