Class: Io::Flow::V0::Models::ShopifyItemEventBucket
- Inherits:
-
ShopifyEventBucket
- Object
- ShopifyEventBucket
- Io::Flow::V0::Models::ShopifyItemEventBucket
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
Attributes inherited from ShopifyEventBucket
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShopifyItemEventBucket
constructor
A new instance of ShopifyItemEventBucket.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ShopifyEventBucket
Constructor Details
#initialize(incoming = {}) ⇒ ShopifyItemEventBucket
Returns a new instance of ShopifyItemEventBucket.
41266 41267 41268 41269 41270 41271 41272 41273 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41266 def initialize(incoming={}) super(:discriminator => ShopifyEventBucket::Types::SHOPIFY_ITEM_EVENT_BUCKET) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:range, :count, :data], 'ShopifyItemEventBucket') @range = (x = opts.delete(:range); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x)) @count = HttpClient::Preconditions.assert_class('count', opts.delete(:count), Integer) @data = HttpClient::Preconditions.assert_class('data', opts.delete(:data), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::ShopifyItemEventData) ? x : ::Io::Flow::V0::Models::ShopifyItemEventData.new(x)) } end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
41264 41265 41266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41264 def count @count end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
41264 41265 41266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41264 def data @data end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
41264 41265 41266 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41264 def range @range end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
41279 41280 41281 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41279 def copy(incoming={}) ShopifyItemEventBucket.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
41283 41284 41285 41286 41287 41288 41289 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41283 def subtype_to_hash { :range => range.to_hash, :count => count, :data => data.map { |o| o.to_hash } } end |
#to_json ⇒ Object
41275 41276 41277 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41275 def to_json JSON.dump(to_hash) end |