Class: Io::Flow::V0::Models::SubcatalogStatistics

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Statistics related to the items in this subcatalog, including item count, number of distinct categories, etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SubcatalogStatistics

Returns a new instance of SubcatalogStatistics.



25136
25137
25138
25139
25140
25141
25142
25143
25144
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25136

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:excluded, :included, :restricted, :queue, :catalog], 'SubcatalogStatistics')
  @excluded = (x = opts.delete(:excluded); x.is_a?(::Io::Flow::V0::Models::ItemStatistics) ? x : ::Io::Flow::V0::Models::ItemStatistics.new(x))
  @included = (x = opts.delete(:included); x.is_a?(::Io::Flow::V0::Models::ItemStatistics) ? x : ::Io::Flow::V0::Models::ItemStatistics.new(x))
  @restricted = (x = opts.delete(:restricted); x.is_a?(::Io::Flow::V0::Models::ItemStatistics) ? x : ::Io::Flow::V0::Models::ItemStatistics.new(x))
  @queue = (x = opts.delete(:queue); x.is_a?(::Io::Flow::V0::Models::ItemStatistics) ? x : ::Io::Flow::V0::Models::ItemStatistics.new(x))
  @catalog = (x = opts.delete(:catalog); x.is_a?(::Io::Flow::V0::Models::CatalogStatistics) ? x : ::Io::Flow::V0::Models::CatalogStatistics.new(x))
end

Instance Attribute Details

#catalogObject (readonly)

Returns the value of attribute catalog.



25134
25135
25136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25134

def catalog
  @catalog
end

#excludedObject (readonly)

Returns the value of attribute excluded.



25134
25135
25136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25134

def excluded
  @excluded
end

#includedObject (readonly)

Returns the value of attribute included.



25134
25135
25136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25134

def included
  @included
end

#queueObject (readonly)

Returns the value of attribute queue.



25134
25135
25136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25134

def queue
  @queue
end

#restrictedObject (readonly)

Returns the value of attribute restricted.



25134
25135
25136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25134

def restricted
  @restricted
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25150
25151
25152
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25150

def copy(incoming={})
  SubcatalogStatistics.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



25154
25155
25156
25157
25158
25159
25160
25161
25162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25154

def to_hash
  {
    :excluded => excluded.to_hash,
    :included => included.to_hash,
    :restricted => restricted.to_hash,
    :queue => queue.to_hash,
    :catalog => catalog.to_hash
  }
end

#to_jsonObject



25146
25147
25148
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25146

def to_json
  JSON.dump(to_hash)
end