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.
59918 59919 59920 59921 59922 59923 59924 59925 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59918 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.
59916 59917 59918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59916 def currency @currency end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
59916 59917 59918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59916 def includes @includes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
59916 59917 59918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59916 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
59916 59917 59918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59916 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
59931 59932 59933 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59931 def copy(incoming={}) PriceBookForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
59935 59936 59937 59938 59939 59940 59941 59942 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59935 def to_hash { :currency => currency, :name => name, :includes => includes.value, :status => status.value } end |
#to_json ⇒ Object
59927 59928 59929 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59927 def to_json JSON.dump(to_hash) end |