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.
36581 36582 36583 36584 36585 36586 36587 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36581 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:price], 'ItemPriceUpdatePutForm') @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, 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.
36579 36580 36581 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36579 def attributes @attributes end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
36579 36580 36581 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36579 def currency @currency end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
36579 36580 36581 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36579 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36593 36594 36595 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36593 def copy(incoming={}) ItemPriceUpdatePutForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36597 36598 36599 36600 36601 36602 36603 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36597 def to_hash { :currency => currency, :price => price.to_f.to_s, :attributes => attributes } end |
#to_json ⇒ Object
36589 36590 36591 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36589 def to_json JSON.dump(to_hash) end |