Class: Io::Flow::V0::Models::PriceSourcePriceBook
- Inherits:
-
PriceSource
- Object
- PriceSource
- Io::Flow::V0::Models::PriceSourcePriceBook
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
-
#price_book_reference ⇒ Object
readonly
Returns the value of attribute price_book_reference.
Attributes inherited from PriceSource
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PriceSourcePriceBook
constructor
A new instance of PriceSourcePriceBook.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from PriceSource
Constructor Details
#initialize(incoming = {}) ⇒ PriceSourcePriceBook
Returns a new instance of PriceSourcePriceBook.
44685 44686 44687 44688 44689 44690 44691 44692 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44685 def initialize(incoming={}) super(:discriminator => PriceSource::Types::PRICE_SOURCE_PRICE_BOOK) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:price, :includes, :price_book_reference], 'PriceSourcePriceBook') @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x)) @includes = (x = opts.delete(:includes); x.is_a?(::Io::Flow::V0::Models::IncludedLevies) ? x : ::Io::Flow::V0::Models::IncludedLevies.new(x)) @price_book_reference = (x = opts.delete(:price_book_reference); x.is_a?(::Io::Flow::V0::Models::PriceSourcePriceBookReference) ? x : ::Io::Flow::V0::Models::PriceSourcePriceBookReference.new(x)) end |
Instance Attribute Details
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
44683 44684 44685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44683 def includes @includes end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
44683 44684 44685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44683 def price @price end |
#price_book_reference ⇒ Object (readonly)
Returns the value of attribute price_book_reference.
44683 44684 44685 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44683 def price_book_reference @price_book_reference end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
44698 44699 44700 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44698 def copy(incoming={}) PriceSourcePriceBook.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
44702 44703 44704 44705 44706 44707 44708 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44702 def subtype_to_hash { :price => price.to_hash, :includes => includes.to_hash, :price_book_reference => price_book_reference.to_hash } end |
#to_json ⇒ Object
44694 44695 44696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44694 def to_json JSON.dump(to_hash) end |