Class: Ansr::Facets::FacetField
- Inherits:
-
Object
- Object
- Ansr::Facets::FacetField
- Defined in:
- lib/ansr/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
- #sort ⇒ Object
Constructor Details
#initialize(name, items, options = {}) ⇒ FacetField
Returns a new instance of FacetField.
32 33 34 35 |
# File 'lib/ansr/facets.rb', line 32 def initialize name, items, = {} @name, @items = name, items @options = end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
31 32 33 |
# File 'lib/ansr/facets.rb', line 31 def items @items end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/ansr/facets.rb', line 31 def name @name end |
Instance Method Details
#limit ⇒ Object
37 38 39 |
# File 'lib/ansr/facets.rb', line 37 def limit @options[:limit] end |
#offset ⇒ Object
45 46 47 |
# File 'lib/ansr/facets.rb', line 45 def offset @options[:offset] || 0 end |
#sort ⇒ Object
41 42 43 |
# File 'lib/ansr/facets.rb', line 41 def sort @options[:sort] || 'index' end |