Class: Io::Flow::V0::Models::PriceBook
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PriceBook
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents a list of target prices in 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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#includes ⇒ Object
readonly
Returns the value of attribute includes.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#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 = {}) ⇒ PriceBook
constructor
A new instance of PriceBook.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PriceBook
Returns a new instance of PriceBook.
59847 59848 59849 59850 59851 59852 59853 59854 59855 59856 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59847 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :key, :currency, :name, :includes, :status], 'PriceBook') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @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::IncludedLevies) ? x : ::Io::Flow::V0::Models::IncludedLevies.new(x)) @status = (x = opts.delete(:status); 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.
59845 59846 59847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59845 def currency @currency end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
59845 59846 59847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59845 def id @id end |
#includes ⇒ Object (readonly)
Returns the value of attribute includes.
59845 59846 59847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59845 def includes @includes end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
59845 59846 59847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59845 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
59845 59846 59847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59845 def name @name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
59845 59846 59847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59845 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
59862 59863 59864 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59862 def copy(incoming={}) PriceBook.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
59866 59867 59868 59869 59870 59871 59872 59873 59874 59875 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59866 def to_hash { :id => id, :key => key, :currency => currency, :name => name, :includes => includes.to_hash, :status => status.value } end |
#to_json ⇒ Object
59858 59859 59860 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 59858 def to_json JSON.dump(to_hash) end |