Class: Europeana::Blacklight::Response::Facets::FacetField

Inherits:
Object
  • Object
show all
Defined in:
lib/europeana/blacklight/response/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.



41
42
43
44
45
# File 'lib/europeana/blacklight/response/facets.rb', line 41

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

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



39
40
41
# File 'lib/europeana/blacklight/response/facets.rb', line 39

def items
  @items
end

#nameObject (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

#limitObject



47
48
49
# File 'lib/europeana/blacklight/response/facets.rb', line 47

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

#offsetObject



51
52
53
# File 'lib/europeana/blacklight/response/facets.rb', line 51

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

#prefixObject

Expected by Blacklight::Facet#facet_paginator



56
# File 'lib/europeana/blacklight/response/facets.rb', line 56

def prefix; end

#sortObject



58
59
60
61
# File 'lib/europeana/blacklight/response/facets.rb', line 58

def sort
  # Europeana API does not support facet sorting
  nil
end