Class: Europeana::Blacklight::Response::Facets::FacetField
- Inherits:
-
Object
- Object
- Europeana::Blacklight::Response::Facets::FacetField
- Defined in:
- lib/europeana/blacklight/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
-
#initialize(name, items, options = {}) ⇒ FacetField
constructor
A new instance of FacetField.
- #limit ⇒ Object
- #offset ⇒ Object
-
#prefix ⇒ Object
Expected by Blacklight::Facet#facet_paginator.
- #sort ⇒ Object
Constructor Details
#initialize(name, items, options = {}) ⇒ FacetField
Returns a new instance of FacetField.
41 42 43 44 45 |
# File 'lib/europeana/blacklight/response/facets.rb', line 41 def initialize(name, items, = {}) @name = name @items = items @options = end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
39 40 41 |
# File 'lib/europeana/blacklight/response/facets.rb', line 39 def items @items end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
39 40 41 |
# File 'lib/europeana/blacklight/response/facets.rb', line 39 def name @name end |
Instance Method Details
#limit ⇒ Object
47 48 49 |
# File 'lib/europeana/blacklight/response/facets.rb', line 47 def limit @options[:limit] || default_limit end |
#offset ⇒ Object
51 52 53 |
# File 'lib/europeana/blacklight/response/facets.rb', line 51 def offset @options[:offset] || default_offset end |
#prefix ⇒ Object
Expected by Blacklight::Facet#facet_paginator
56 |
# File 'lib/europeana/blacklight/response/facets.rb', line 56 def prefix; end |
#sort ⇒ Object
58 59 60 61 |
# File 'lib/europeana/blacklight/response/facets.rb', line 58 def sort # Europeana API does not support facet sorting nil end |