Class: Io::Flow::V0::Models::LocalizedCachePrice
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::LocalizedCachePrice
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents a specific localized price
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ LocalizedCachePrice
constructor
A new instance of LocalizedCachePrice.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ LocalizedCachePrice
Returns a new instance of LocalizedCachePrice.
19201 19202 19203 19204 19205 19206 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19201 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:key, :price], 'LocalizedCachePrice') @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @price = (x = opts.delete(:price); x.is_a?(::Io::Flow::V0::Models::PriceWithBase) ? x : ::Io::Flow::V0::Models::PriceWithBase.new(x)) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
19199 19200 19201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19199 def key @key end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
19199 19200 19201 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19199 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
19212 19213 19214 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19212 def copy(incoming={}) LocalizedCachePrice.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
19216 19217 19218 19219 19220 19221 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19216 def to_hash { :key => key, :price => price.to_hash } end |
#to_json ⇒ Object
19208 19209 19210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19208 def to_json JSON.dump(to_hash) end |