Class: Blacklight::Solr::Response::Facets::FacetField
- Inherits:
-
Object
- Object
- Blacklight::Solr::Response::Facets::FacetField
- Defined in:
- lib/blacklight/solr/response/facets.rb
Overview
represents a facet; which is a field and its values
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #count? ⇒ Boolean
- #index? ⇒ Boolean
-
#initialize(name, items, options = {}) ⇒ FacetField
constructor
A new instance of FacetField.
- #limit ⇒ Object
- #offset ⇒ Object
- #prefix ⇒ Object
- #sort ⇒ Object
Constructor Details
#initialize(name, items, options = {}) ⇒ FacetField
Returns a new instance of FacetField.
32 33 34 35 36 |
# File 'lib/blacklight/solr/response/facets.rb', line 32 def initialize name, items, = {} @name = name @items = items @options = end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
31 32 33 |
# File 'lib/blacklight/solr/response/facets.rb', line 31 def items @items end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/blacklight/solr/response/facets.rb', line 31 def name @name end |
Instance Method Details
#count? ⇒ Boolean
58 59 60 |
# File 'lib/blacklight/solr/response/facets.rb', line 58 def count? sort == 'count' end |
#index? ⇒ Boolean
54 55 56 |
# File 'lib/blacklight/solr/response/facets.rb', line 54 def index? sort == 'index' end |
#limit ⇒ Object
38 39 40 |
# File 'lib/blacklight/solr/response/facets.rb', line 38 def limit @options[:limit] || solr_default_limit end |
#offset ⇒ Object
46 47 48 |
# File 'lib/blacklight/solr/response/facets.rb', line 46 def offset @options[:offset] || solr_default_offset end |
#prefix ⇒ Object
50 51 52 |
# File 'lib/blacklight/solr/response/facets.rb', line 50 def prefix @options[:prefix] || solr_default_prefix end |
#sort ⇒ Object
42 43 44 |
# File 'lib/blacklight/solr/response/facets.rb', line 42 def sort @options[:sort] || solr_default_sort end |