Class: Io::Flow::V0::Models::ExperienceInventoryItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ExperienceInventoryItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Model for status of an item in an experience
Instance Attribute Summary collapse
-
#experience ⇒ Object
readonly
Returns the value of attribute experience.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ExperienceInventoryItem
constructor
A new instance of ExperienceInventoryItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ExperienceInventoryItem
Returns a new instance of ExperienceInventoryItem.
23696 23697 23698 23699 23700 23701 23702 23703 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23696 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :experience, :item, :status], 'ExperienceInventoryItem') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::InventoryExperienceReference) ? x : ::Io::Flow::V0::Models::InventoryExperienceReference.new(x)) @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::ItemReference) ? x : ::Io::Flow::V0::Models::ItemReference.new(x)) @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::ExperienceInventoryItemStatus) ? x : ::Io::Flow::V0::Models::ExperienceInventoryItemStatus.apply(x)) end |
Instance Attribute Details
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
23694 23695 23696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23694 def experience @experience end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23694 23695 23696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23694 def id @id end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
23694 23695 23696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23694 def item @item end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
23694 23695 23696 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23694 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23709 23710 23711 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23709 def copy(incoming={}) ExperienceInventoryItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
23713 23714 23715 23716 23717 23718 23719 23720 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23713 def to_hash { :id => id, :experience => experience.to_hash, :item => item.to_hash, :status => status.value } end |
#to_json ⇒ Object
23705 23706 23707 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23705 def to_json JSON.dump(to_hash) end |