Class: Io::Flow::V0::Models::SubcatalogStatistics
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SubcatalogStatistics
- 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
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
-
#excluded ⇒ Object
readonly
Returns the value of attribute excluded.
-
#included ⇒ Object
readonly
Returns the value of attribute included.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
-
#restricted ⇒ Object
readonly
Returns the value of attribute restricted.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SubcatalogStatistics
constructor
A new instance of SubcatalogStatistics.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SubcatalogStatistics
Returns a new instance of SubcatalogStatistics.
69220 69221 69222 69223 69224 69225 69226 69227 69228 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69220 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
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
69218 69219 69220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69218 def catalog @catalog end |
#excluded ⇒ Object (readonly)
Returns the value of attribute excluded.
69218 69219 69220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69218 def excluded @excluded end |
#included ⇒ Object (readonly)
Returns the value of attribute included.
69218 69219 69220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69218 def included @included end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
69218 69219 69220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69218 def queue @queue end |
#restricted ⇒ Object (readonly)
Returns the value of attribute restricted.
69218 69219 69220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69218 def restricted @restricted end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
69234 69235 69236 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69234 def copy(incoming={}) SubcatalogStatistics.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
69238 69239 69240 69241 69242 69243 69244 69245 69246 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69238 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_json ⇒ Object
69230 69231 69232 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 69230 def to_json JSON.dump(to_hash) end |