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.
45286 45287 45288 45289 45290 45291 45292 45293 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45286 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.
45284 45285 45286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45284 def currency @currency end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
45284 45285 45286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45284 def includes @includes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
45284 45285 45286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45284 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
45284 45285 45286 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45284 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
45299 45300 45301 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45299 def copy(incoming={}) PriceBookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
45303 45304 45305 45306 45307 45308 45309 45310 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45303 def to_hash { :currency => currency, :name => name, :includes => includes.value, :status => status.value } end |
#to_json ⇒ Object
45295 45296 45297 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45295 def to_json JSON.dump(to_hash) end |