Class: Solr::Query::Response::FieldFacets

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/solr/query/response/field_facets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field:, facet_values:, count:, subfacets: []) ⇒ FieldFacets

Returns a new instance of FieldFacets.



9
10
11
12
13
14
15
16
# File 'lib/solr/query/response/field_facets.rb', line 9

def initialize(field:, facet_values:, count:, subfacets: [])
  @field        = field
  @facet_values = facet_values
  @count        = count
  @subfacets    = subfacets

  freeze
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



7
8
9
# File 'lib/solr/query/response/field_facets.rb', line 7

def count
  @count
end

#facet_valuesObject (readonly)

Returns the value of attribute facet_values.



7
8
9
# File 'lib/solr/query/response/field_facets.rb', line 7

def facet_values
  @facet_values
end

#fieldObject (readonly)

Returns the value of attribute field.



7
8
9
# File 'lib/solr/query/response/field_facets.rb', line 7

def field
  @field
end

#subfacetsObject (readonly)

Returns the value of attribute subfacets.



7
8
9
# File 'lib/solr/query/response/field_facets.rb', line 7

def subfacets
  @subfacets
end

Instance Method Details

#each(&b) ⇒ Object



18
19
20
21
# File 'lib/solr/query/response/field_facets.rb', line 18

def each(&b)
  return enum_for(:each) unless block_given?
  facet_values.each(&b)
end