Class: Io::Flow::V0::Models::OrderQuoteSummaryTotal

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

Returns a new instance of OrderQuoteSummaryTotal.



49739
49740
49741
49742
49743
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49739

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

#totalObject (readonly)

Returns the value of attribute total.



49737
49738
49739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49737

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49749
49750
49751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49749

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

#to_hashObject



49753
49754
49755
49756
49757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49753

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

#to_jsonObject



49745
49746
49747
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49745

def to_json
  JSON.dump(to_hash)
end