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.
42856 42857 42858 42859 42860 42861 42862 42863 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42856 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.
42854 42855 42856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42854 def currency @currency end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
42854 42855 42856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42854 def includes @includes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
42854 42855 42856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42854 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
42854 42855 42856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42854 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
42869 42870 42871 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42869 def copy(incoming={}) PriceBookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
42873 42874 42875 42876 42877 42878 42879 42880 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42873 def to_hash { :currency => currency, :name => name, :includes => includes.value, :status => status.value } end |
#to_json ⇒ Object
42865 42866 42867 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42865 def to_json JSON.dump(to_hash) end |