Class: Io::Flow::V0::Models::ShopifyItemEventData
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShopifyItemEventData
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#experience ⇒ Object
readonly
Returns the value of attribute experience.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyItemEventData
constructor
A new instance of ShopifyItemEventData.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyItemEventData
Returns a new instance of ShopifyItemEventData.
50017 50018 50019 50020 50021 50022 50023 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50017 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:created_at, :experience, :item], 'ShopifyItemEventData') @created_at = HttpClient::Preconditions.assert_class('created_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:created_at)), DateTime) @experience = (x = opts.delete(:experience); x.is_a?(::Io::Flow::V0::Models::ExperienceReference) ? x : ::Io::Flow::V0::Models::ExperienceReference.new(x)) @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::CatalogItemSummary) ? x : ::Io::Flow::V0::Models::CatalogItemSummary.new(x)) end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
50015 50016 50017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50015 def created_at @created_at end |
#experience ⇒ Object (readonly)
Returns the value of attribute experience.
50015 50016 50017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50015 def experience @experience end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
50015 50016 50017 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50015 def item @item end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
50029 50030 50031 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50029 def copy(incoming={}) ShopifyItemEventData.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
50033 50034 50035 50036 50037 50038 50039 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50033 def to_hash { :created_at => created_at, :experience => experience.to_hash, :item => item.to_hash } end |
#to_json ⇒ Object
50025 50026 50027 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50025 def to_json JSON.dump(to_hash) end |