Class: Io::Flow::V0::Models::PriceBookForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceBookForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents a price book for a specific currency that can override any subset of item prices within an experience.
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ PriceBookForm
constructor
A new instance of PriceBookForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PriceBookForm
41594 41595 41596 41597 41598 41599 41600 41601 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41594 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:currency, :name, :includes], 'PriceBookForm') @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @includes = (x = opts.delete(:includes); x.is_a?(::Io::Flow::V0::Models::IncludedLevyKey) ? x : ::Io::Flow::V0::Models::IncludedLevyKey.apply(x)) @status = (x = (x = opts.delete(:status); x.nil? ? "draft" : x); x.is_a?(::Io::Flow::V0::Models::PriceBookStatus) ? x : ::Io::Flow::V0::Models::PriceBookStatus.apply(x)) end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
41592 41593 41594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41592 def currency @currency end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
41592 41593 41594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41592 def includes @includes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
41592 41593 41594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41592 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
41592 41593 41594 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41592 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41607 41608 41609 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41607 def copy(incoming={}) PriceBookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
41611 41612 41613 41614 41615 41616 41617 41618 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41611 def to_hash { :currency => currency, :name => name, :includes => includes.value, :status => status.value } end |
#to_json ⇒ Object
41603 41604 41605 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41603 def to_json JSON.dump(to_hash) end |