Module: Exlibris::Aleph::Config::Attributes

Included in:
Rest::Base, TabHelper
Defined in:
lib/exlibris/aleph/config.rb

Overview

These attributes default to the global config settings if not specified locally.

Instance Method Summary collapse

Instance Method Details

#admsObject

Aleph ADMs to parse



44
45
46
# File 'lib/exlibris/aleph/config.rb', line 44

def adms
  @adms ||= (config.adms) ? config.adms.collect{|adm| adm.downcase} : []
end

#base_urlObject

Aleph base url



29
30
31
# File 'lib/exlibris/aleph/config.rb', line 29

def base_url
  @base_url ||= String.new config.base_url.to_s
end

#configObject



24
25
26
# File 'lib/exlibris/aleph/config.rb', line 24

def config
  @config ||= Config
end

#irrelevant_sub_librariesObject



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/exlibris/aleph/config.rb', line 62

def irrelevant_sub_libraries
  @irrelevant_sub_libraries ||= 
    (config.irrelevant_sub_libraries) ? config.irrelevant_sub_libraries : 
      [ "USR00", "HOME", "BOX", "ILLDT", "NYU51", "ALEPH", "USM50",
        "MED", "HYL", "HIL", "LAM", "LAW", "LIT", "MUS", "WID", "EXL", "CIRC", "HILR", "HIL01",
        "HYL01", "HYL02", "HYL03", "HYL04", "HYL05", "HYL06", "LAM01", "LAM02", "LAM03", "LAW01",
        "LAW02", "LAW03", "LIT01", "LIT02", "MED01", "MED02", "MUS01", "MUS02", "WID01", "WID02",
        "WID03", "WID04", "WID05", "U60WD", "U60HL", "U60LA", "U70WD", "CBAB", "BCU", "MBAZU", "USM51",
        "ELEC5", "GDOC5", "EDUC5", "LINC5", "RRLIN", "OU511", "OR512", "OR513", "OR514", "OR515", "U61ED",
        "U61EL", "U61LN", "S61GD", "USM53", "ELEC7", "GDOC7", "EDUC7", "LINC7", "USM54", "ELEC4", "USM55",
        "CUN50", "CLEC5", "CDOC5", "CDUC5", "CINC5", "UNI50", "NARCV", "NELEC", "NRLEC", "NGDOC", "NRDOC",
        "NEDUC", "NHLTH", "NLINC", "NLAW", "NMUSI", "NSCI", "NUPTN" ]
end

#loggerObject



58
59
60
# File 'lib/exlibris/aleph/config.rb', line 58

def logger
  @logger ||= (config.logger) ? config.logger : Logger.new(File.join(yml_path, "..", "..", "log", "exlibris_aleph.log"))
end

#refresh_timeObject

Refresh time for TabHelper



39
40
41
# File 'lib/exlibris/aleph/config.rb', line 39

def refresh_time
  @refresh_time ||= (config.refresh_time) ? config.refresh_time : lambda{1.day.ago}
end

#rest_urlObject

Aleph rest url



34
35
36
# File 'lib/exlibris/aleph/config.rb', line 34

def rest_url
  @rest_url ||= (config.rest_url) ? String.new(config.rest_url.to_s) : "#{base_url}:1891/rest-dlf"
end

#tab_pathObject

Tab path for Aleph tables



49
50
51
# File 'lib/exlibris/aleph/config.rb', line 49

def tab_path
  @tab_path ||= File.join(config.tab_path)
end

#yml_pathObject

YAML path for persisting Aleph config



54
55
56
# File 'lib/exlibris/aleph/config.rb', line 54

def yml_path
  @yml_path ||= (File.join(config.yml_path) || File.join(tab_path, "..", "config", "aleph"))
end