class Exlibris::Primo::FacetValue

Primo facet value that holds the name of the value and the number of records that limiting by this facet value would return.

Attributes

facet[RW]

Public Class Methods

new(*args) click to toggle source
Calls superclass method Exlibris::Primo::WriteAttributes::new
# File lib/exlibris/primo/facet_value.rb, line 16
def initialize *args
  @raw_xml = args.last.delete(:raw_xml)
  super
end

Public Instance Methods

count()
Alias for: size
display_name() click to toggle source
# File lib/exlibris/primo/facet_value.rb, line 25
def display_name
  return @display_name ||= (ISO_639.find(name).english_name || name) if facet.name.eql? "lang"
  return @display_name ||= (config.libraries[name] || name) if facet.name.eql? "library"
  return @display_name ||= (config.facet_top_level[name] || name) if facet.name.eql? "tlevel"
  return @display_name ||= (config.facet_collections[name] || name) if facet.name.eql? "domain"
  return @display_name ||= (config.facet_resource_types[name] || name) if facet.name.eql? "rtype"
  @display_name ||= name
end
name() click to toggle source
# File lib/exlibris/primo/facet_value.rb, line 21
def name
  @name ||= xml.root["KEY"]
end
size() click to toggle source
# File lib/exlibris/primo/facet_value.rb, line 34
def size
  @size = Integer(xml.root["VALUE"])
end
Also aliased as: count