Class: Io::Flow::V0::Models::OrderQuotePriceEstimated

Inherits:
OrderQuotePrice show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from OrderQuotePrice

#discriminator

Instance Method Summary collapse

Methods inherited from OrderQuotePrice

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrderQuotePriceEstimated

Returns a new instance of OrderQuotePriceEstimated.



49342
49343
49344
49345
49346
49347
49348
49349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49342

def initialize(incoming={})
  super(:discriminator => OrderQuotePrice::Types::ORDER_QUOTE_PRICE_ESTIMATED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:amount, :currency, :label], 'OrderQuotePriceEstimated')
  @amount = HttpClient::Preconditions.assert_class('amount', opts.delete(:amount), Numeric)
  @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String)
  @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



49340
49341
49342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49340

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



49340
49341
49342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49340

def currency
  @currency
end

#labelObject (readonly)

Returns the value of attribute label.



49340
49341
49342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49340

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49355
49356
49357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49355

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

#subtype_to_hashObject



49359
49360
49361
49362
49363
49364
49365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49359

def subtype_to_hash
  {
    :amount => amount,
    :currency => currency,
    :label => label
  }
end

#to_jsonObject



49351
49352
49353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49351

def to_json
  JSON.dump(to_hash)
end