Class: Io::Flow::V0::Models::OrderQuoteSummaryShippingFreight

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

Returns a new instance of OrderQuoteSummaryShippingFreight.



49659
49660
49661
49662
49663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49659

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



49657
49658
49659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49657

def total
  @total
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49669
49670
49671
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49669

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

#to_hashObject



49673
49674
49675
49676
49677
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49673

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

#to_jsonObject



49665
49666
49667
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49665

def to_json
  JSON.dump(to_hash)
end