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.



47351
47352
47353
47354
47355
47356
47357
47358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47351

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.



47349
47350
47351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47349

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



47349
47350
47351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47349

def currency
  @currency
end

#labelObject (readonly)

Returns the value of attribute label.



47349
47350
47351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47349

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47364
47365
47366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47364

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

#subtype_to_hashObject



47368
47369
47370
47371
47372
47373
47374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47368

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

#to_jsonObject



47360
47361
47362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47360

def to_json
  JSON.dump(to_hash)
end