Class: Io::Flow::V0::Models::CatalogItemSummary
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CatalogItemSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CatalogItemSummary
constructor
A new instance of CatalogItemSummary.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CatalogItemSummary
Returns a new instance of CatalogItemSummary.
13473 13474 13475 13476 13477 13478 13479 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13473 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :name, :attributes], 'CatalogItemSummary') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), 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.
13471 13472 13473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13471 def attributes @attributes end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13471 13472 13473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13471 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
13471 13472 13473 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13471 def number @number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13485 13486 13487 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13485 def copy(incoming={}) CatalogItemSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
13489 13490 13491 13492 13493 13494 13495 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13489 def to_hash { :number => number, :name => name, :attributes => attributes } end |
#to_json ⇒ Object
13481 13482 13483 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13481 def to_json JSON.dump(to_hash) end |