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
52814 52815 52816 52817 52818 52819 52820 52821 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52814 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.
52812 52813 52814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52812 def currency @currency end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
52812 52813 52814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52812 def includes @includes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
52812 52813 52814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52812 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
52812 52813 52814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52812 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52827 52828 52829 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52827 def copy(incoming={}) PriceBookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52831 52832 52833 52834 52835 52836 52837 52838 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52831 def to_hash { :currency => currency, :name => name, :includes => includes.value, :status => status.value } end |
#to_json ⇒ Object
52823 52824 52825 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52823 def to_json JSON.dump(to_hash) end |