class Europeana::Blacklight::Response::Facets::FacetField

represents a facet; which is a field and its values

Attributes

items[R]
name[R]

Public Class Methods

new(name, items, options = {}) click to toggle source
# File lib/europeana/blacklight/response/facets.rb, line 41
def initialize(name, items, options = {})
  @name = name
  @items = items
  @options = options
end

Public Instance Methods

limit() click to toggle source
# File lib/europeana/blacklight/response/facets.rb, line 47
def limit
  @options[:limit] || default_limit
end
offset() click to toggle source
# File lib/europeana/blacklight/response/facets.rb, line 51
def offset
  @options[:offset] || default_offset
end
prefix() click to toggle source

Expected by {Blacklight::Facet#facet_paginator}

# File lib/europeana/blacklight/response/facets.rb, line 56
def prefix; end
sort() click to toggle source
# File lib/europeana/blacklight/response/facets.rb, line 58
def sort
  # Europeana API does not support facet sorting
  nil
end

Private Instance Methods

default_limit() click to toggle source

@see labs.europeana.eu/api/search/#offset-and-limit-of-facets

# File lib/europeana/blacklight/response/facets.rb, line 66
def default_limit
  100
end
default_offset() click to toggle source

@see labs.europeana.eu/api/search/#offset-and-limit-of-facets

# File lib/europeana/blacklight/response/facets.rb, line 71
def default_offset
  0
end