Class: Io::Flow::V0::Models::ItemPriceUpdatePutForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ItemPriceUpdatePutForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ItemPriceUpdatePutForm
constructor
A new instance of ItemPriceUpdatePutForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ItemPriceUpdatePutForm
Returns a new instance of ItemPriceUpdatePutForm.
22389 22390 22391 22392 22393 22394 22395 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22389 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:currency, :price], 'ItemPriceUpdatePutForm') @currency = HttpClient::Preconditions.assert_class('currency', opts.delete(:currency), String) @price = HttpClient::Preconditions.assert_class('price', HttpClient::Helper.to_big_decimal(opts.delete(:price)), BigDecimal) @attributes = HttpClient::Preconditions.assert_class('attributes', (x = opts.delete(:attributes); x.nil? ? {} : x), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h } end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
22387 22388 22389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22387 def attributes @attributes end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
22387 22388 22389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22387 def currency @currency end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
22387 22388 22389 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22387 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
22401 22402 22403 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22401 def copy(incoming={}) ItemPriceUpdatePutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
22405 22406 22407 22408 22409 22410 22411 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22405 def to_hash { :currency => currency, :price => price, :attributes => attributes } end |
#to_json ⇒ Object
22397 22398 22399 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22397 def to_json JSON.dump(to_hash) end |