class AboutYou::SDK::Model::FacetCounts

This class represents a FacetCounts model.

author

Collins GmbH & Co KG

Attributes

facet_count_list[RW]

an array of facetcount objects

group_id[RW]

The group_id of the facetcounts

product_count_total[RW]

the cont of the products

product_count_with_other_facet[RW]

the count of the procuts with other facets

product_count_without_any_facet[RW]

the count of the products without facets

Public Class Methods

create_from_json(group_id, json_object, facet_count_list) click to toggle source

This method is used for creating an instance of this class by a json_object.

  • Args :

    • group_id -> the groupId of the facetcounts

    • json_object -> the jsonObject received from the api

    • facet_count_list -> a list of facetcount objects

  • Returns :

# File lib/AboutYou/Model/ProductSearchResult/facet_counts.rb, line 53
def self.create_from_json(group_id, json_object, facet_count_list)
  facet_counts = new(
    json_object['total'],
    json_object['other'],
    json_object['missing']
  )
  facet_counts.group_id = group_id
  facet_counts.facet_count_list = facet_count_list

  facet_counts
end
new( product_count_total, product_count_with_other_facet, product_count_without_any_facet ) click to toggle source

the Constructor for the facetcounts class

  • Args :

    • product_count_total -> the total productcount

    • product_count_with_other_facet -> the productcount without any facets

    • product_count_without_any_facet -> the productcount with other facets

  • Returns :

# File lib/AboutYou/Model/ProductSearchResult/facet_counts.rb, line 32
def initialize(
    product_count_total,
    product_count_with_other_facet,
    product_count_without_any_facet
  )
  self.product_count_total             = product_count_total
  self.product_count_with_other_facet  = product_count_with_other_facet
  self.product_count_without_any_facet = product_count_without_any_facet
end