Sha256: 43f16a672341190f2b7ef45e3cda8c4a94b847d13014935382ab877b8cf2fe3a
Contents?: true
Size: 1.48 KB
Versions: 3
Compression:
Stored size: 1.48 KB
Contents
module Exlibris module Aleph require 'singleton' class TablesManager # Number of seconds before the table is # considered expired, 86400 seconds is 1 day TIME_TO_LIVE = 86400 include Singleton def expired? Time.now > expiration_date end def sub_libraries reset! if expired? @sub_libraries ||= Table::SubLibraries.new end def collections reset! if expired? @collections ||= Table::Collections.new end def patron_statuses reset! if expired? @patron_statuses ||= Table::Patron::Statuses.new end def patron_circulation_policies reset! if expired? @patron_circulation_policies ||= Table::Patron::CirculationPolicies.new end def item_circulation_policies reset! if expired? @item_circulation_policies ||= Table::Item::CirculationPolicies.new end def item_display_masks reset! if expired? @item_display_masks ||= Table::Item::DisplayMasks.new end private def initialize expiration_date end def expiration_date @expiration_date ||= Time.now + TIME_TO_LIVE end def reset! @expiration_date = nil @sub_libraries = nil @collections = nil @patron_statuses = nil @patron_circulation_policies = nil @item_circulation_policies = nil @item_display_masks = nil end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
exlibris-aleph-2.0.4 | lib/exlibris/aleph/tables_manager.rb |
exlibris-aleph-2.0.3 | lib/exlibris/aleph/tables_manager.rb |
exlibris-aleph-2.0.0 | lib/exlibris/aleph/tables_manager.rb |