Sha256: 1c959b92bde3c5f91f7e5b0c4241a8f264abdd179289821650c0c3815834223b
Contents?: true
Size: 1.92 KB
Versions: 2
Compression:
Stored size: 1.92 KB
Contents
require 'erb' module Exlibris module Primo # # Specify global configuration settings for # module Config class << self include WriteAttributes attr_accessor :base_url, :institution, :institutions, :libraries, :availability_statuses, :sources, :facet_labels, :facet_top_level, :facet_collections, :facet_resource_types, :load_time def load_yaml file write_attributes YAML.load(ERB.new(File.read(file)).result) self.load_time = Time.now end end # # These attributes default to the global config settings if not # specified locally. # module Attributes def config @config ||= Config end def base_url @base_url ||= String.new config.base_url.to_s end def institution @institution ||= String.new config.institution.to_s end def institutions @institutions ||= (config.institutions) ? config.institutions.dup : {} end def libraries @libraries ||= (config.libraries) ? config.libraries.dup : {} end def availability_statuses @availability_statuses ||= (config.availability_statuses) ? config.availability_statuses.dup : {} end def sources @sources ||= (config.sources) ? config.sources.dup : {} end def facet_labels @facet_labels ||= (config.facet_labels) ? config.facet_labels.dup : {} end def facet_top_level @facet_top_level ||= (config.facet_top_level) ? config.facet_top_level.dup : {} end def facet_collections @facet_collections ||= (config.facet_collections) ? config.facet_collections.dup : {} end def facet_resource_types @facet_resource_types ||= (config.facet_resource_types) ? config.facet_resource_types.dup : {} end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
exlibris-primo-2.0.0 | lib/exlibris/primo/config.rb |
exlibris-primo-1.1.9 | lib/exlibris/primo/config.rb |