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.



53324
53325
53326
53327
53328
53329
53330
53331
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53324

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.



53322
53323
53324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53322

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



53322
53323
53324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53322

def currency
  @currency
end

#labelObject (readonly)

Returns the value of attribute label.



53322
53323
53324
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53322

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53337
53338
53339
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53337

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

#subtype_to_hashObject



53341
53342
53343
53344
53345
53346
53347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53341

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

#to_jsonObject



53333
53334
53335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53333

def to_json
  JSON.dump(to_hash)
end