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
Returns a new instance of PriceBookForm.
44205 44206 44207 44208 44209 44210 44211 44212 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44205 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.
44203 44204 44205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44203 def currency @currency end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
44203 44204 44205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44203 def includes @includes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
44203 44204 44205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44203 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
44203 44204 44205 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44203 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
44218 44219 44220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44218 def copy(incoming={}) PriceBookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
44222 44223 44224 44225 44226 44227 44228 44229 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44222 def to_hash { :currency => currency, :name => name, :includes => includes.value, :status => status.value } end |
#to_json ⇒ Object
44214 44215 44216 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44214 def to_json JSON.dump(to_hash) end |