Class: Io::Flow::V0::Models::ItemFormOverlayForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ItemFormOverlayForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#categories ⇒ Object
readonly
Returns the value of attribute categories.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ItemFormOverlayForm
constructor
A new instance of ItemFormOverlayForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ItemFormOverlayForm
Returns a new instance of ItemFormOverlayForm.
36208 36209 36210 36211 36212 36213 36214 36215 36216 36217 36218 36219 36220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36208 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number], 'ItemFormOverlayForm') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @price = (x = opts.delete(:price); x.nil? ? nil : HttpClient::Preconditions.assert_class('price', x, Numeric)) @currency = (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)) @position = (x = opts.delete(:position); x.nil? ? nil : HttpClient::Preconditions.assert_class('position', x, Integer)) @categories = (x = opts.delete(:categories); x.nil? ? nil : HttpClient::Preconditions.assert_class('categories', x, Array).map { |v| HttpClient::Preconditions.assert_class('categories', v, String) }) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }) @dimensions = (x = opts.delete(:dimensions); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Dimensions) ? x : ::Io::Flow::V0::Models::Dimensions.new(x))) @images = (x = opts.delete(:images); x.nil? ? nil : HttpClient::Preconditions.assert_class('images', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ImageForm) ? x : ::Io::Flow::V0::Models::ImageForm.new(x)) }) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def attributes @attributes end |
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def categories @categories end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def description @description end |
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def dimensions @dimensions end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def images @images end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def number @number end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def position @position end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
36206 36207 36208 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36206 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36226 36227 36228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36226 def copy(incoming={}) ItemFormOverlayForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36230 36231 36232 36233 36234 36235 36236 36237 36238 36239 36240 36241 36242 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36230 def to_hash { :number => number, :price => price, :currency => currency, :position => position, :categories => categories.nil? ? nil : categories, :description => description, :attributes => attributes.nil? ? nil : attributes, :dimensions => dimensions.nil? ? nil : dimensions.to_hash, :images => images.nil? ? nil : images.map { |o| o.to_hash } } end |
#to_json ⇒ Object
36222 36223 36224 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36222 def to_json JSON.dump(to_hash) end |