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.
36906 36907 36908 36909 36910 36911 36912 36913 36914 36915 36916 36917 36918 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36906 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.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def attributes @attributes end |
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def categories @categories end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def description @description end |
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def dimensions @dimensions end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def images @images end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def number @number end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def position @position end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
36904 36905 36906 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36904 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36924 36925 36926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36924 def copy(incoming={}) ItemFormOverlayForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36928 36929 36930 36931 36932 36933 36934 36935 36936 36937 36938 36939 36940 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36928 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
36920 36921 36922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36920 def to_json JSON.dump(to_hash) end |