Sha256: fb7737dfcb502e5537571019ca97dff55f6fa9fab0aacc8a3c1d75a88f24c473
Contents?: true
Size: 851 Bytes
Versions: 97
Compression:
Stored size: 851 Bytes
Contents
# The module 'Goldberg' is the namespace for Goldberg's libraries. It # also provides a number of class methods for convenient access to # information about the system from Goldberg's perspective (the # current user and the System Settings). module Goldberg class << self # Accessor to attach the current user (if logged in) attr_accessor :user # Accessor to attach the session's credentials attr_accessor :credentials # Accessor to attach the session's menu attr_accessor :menu # return nil if there is no user def user begin @user rescue nil end end # Return Goldberg's System Settings def settings @settings ||= Goldberg::SystemSettings.find(:first) end def clear! @user = nil @credentials = nil @menu = nil @settings = nil end end end
Version data entries
97 entries across 97 versions & 2 rubygems