Class: Ansr::Facets::FacetField

Inherits:
Object
  • Object
show all
Defined in:
lib/ansr/facets.rb

Overview

represents a facet; which is a field and its values

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {}
  @name, @items = name, items
  @options = options
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



31
32
33
# File 'lib/ansr/facets.rb', line 31

def items
  @items
end

#nameObject (readonly)

Returns the value of attribute name.



31
32
33
# File 'lib/ansr/facets.rb', line 31

def name
  @name
end

Instance Method Details

#limitObject



37
38
39
# File 'lib/ansr/facets.rb', line 37

def limit
  @options[:limit]
end

#offsetObject



45
46
47
# File 'lib/ansr/facets.rb', line 45

def offset
  @options[:offset] || 0
end

#sortObject



41
42
43
# File 'lib/ansr/facets.rb', line 41

def sort
  @options[:sort] || 'index'
end