Sha256: c2629f4ae5c7741e585bf4f80224b07e6ffa851650f38ad67d415dbdb7b5cef4
Contents?: true
Size: 1.15 KB
Versions: 25
Compression:
Stored size: 1.15 KB
Contents
module Exlibris module Primo require 'iso-639' # # Primo facet value that holds the name of the value # and the number of records that limiting by this facet # value would return. # class FacetValue include Config::Attributes include WriteAttributes include XmlUtil attr_accessor :facet def initialize *args @raw_xml = args.last.delete(:raw_xml) super end def name @name ||= xml.root["KEY"] end 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 def size @size = Integer(xml.root["VALUE"]) end alias :count :size end end end
Version data entries
25 entries across 25 versions & 1 rubygems