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.
34035 34036 34037 34038 34039 34040 34041 34042 34043 34044 34045 34046 34047 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34035 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.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def attributes @attributes end |
#categories ⇒ Object (readonly)
Returns the value of attribute categories.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def categories @categories end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def currency @currency end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def description @description end |
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def dimensions @dimensions end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def images @images end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def number @number end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def position @position end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
34033 34034 34035 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34033 def price @price end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34053 34054 34055 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34053 def copy(incoming={}) ItemFormOverlayForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
34057 34058 34059 34060 34061 34062 34063 34064 34065 34066 34067 34068 34069 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34057 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
34049 34050 34051 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34049 def to_json JSON.dump(to_hash) end |