Class: Io::Flow::V0::Models::OrderQuotePriceStandard

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

Returns a new instance of OrderQuotePriceStandard.



49451
49452
49453
49454
49455
49456
49457
49458
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49451

def initialize(incoming={})
  super(:discriminator => OrderQuotePrice::Types::ORDER_QUOTE_PRICE_STANDARD)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:amount, :currency, :label], 'OrderQuotePriceStandard')
  @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.



49449
49450
49451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49449

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



49449
49450
49451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49449

def currency
  @currency
end

#labelObject (readonly)

Returns the value of attribute label.



49449
49450
49451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49449

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



49464
49465
49466
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49464

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

#subtype_to_hashObject



49468
49469
49470
49471
49472
49473
49474
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49468

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

#to_jsonObject



49460
49461
49462
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 49460

def to_json
  JSON.dump(to_hash)
end