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.



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

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

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



37
38
39
# File 'lib/europeana/blacklight/response/facets.rb', line 37

def items
  @items
end

#nameObject (readonly)

Returns the value of attribute name.



37
38
39
# File 'lib/europeana/blacklight/response/facets.rb', line 37

def name
  @name
end

Instance Method Details

#limitObject



44
45
46
# File 'lib/europeana/blacklight/response/facets.rb', line 44

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

#offsetObject



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

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

#prefixObject

Expected by Blacklight::Facet#facet_paginator



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

def prefix
end

#sortObject



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

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