Class: Dbla::Response::Facets::FacetField

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

Overview

Borrowed from Blacklight

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, items, options = {}) ⇒ FacetField

Returns a new instance of FacetField.



6
7
8
9
# File 'lib/dbla/response/facets.rb', line 6

def initialize name, items, options = {}
  @name, @items = name, items
  @options = options
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



5
6
7
# File 'lib/dbla/response/facets.rb', line 5

def items
  @items
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/dbla/response/facets.rb', line 5

def name
  @name
end

Instance Method Details

#limitObject



11
12
13
# File 'lib/dbla/response/facets.rb', line 11

def limit
  @options[:limit] || default_limit
end

#offsetObject



19
20
21
# File 'lib/dbla/response/facets.rb', line 19

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

#sortObject



15
16
17
# File 'lib/dbla/response/facets.rb', line 15

def sort
  @options[:sort] || default_sort
end