Module: Qlg
Constant Summary collapse
- VERSION =
File.open(File.(File.join(File.dirname(__FILE__),'..','VERSION'))).read.freeze
- LOGS =
Hash.new do |h,k| h[k] = Logger.new("#{k}.log") end
- DEFAULT_NAME =
ENV['RACK_ENV']||ENV['RAILS_ENV']||ENV['MERB_ENV']||'default'
- DEFAULT =
Instance Method Summary collapse
-
#create_log(name) ⇒ Object
Not sure how much faster this is than method missing.
- #default ⇒ Object
- #method_missing(name) ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name) ⇒ Object
29 30 31 |
# File 'lib/qlg.rb', line 29 def method_missing name LOGS[name] end |
Instance Method Details
#create_log(name) ⇒ Object
Not sure how much faster this is than method missing
19 20 21 22 23 24 25 26 27 |
# File 'lib/qlg.rb', line 19 def create_log name name = name.to_s Log.send :define_method, name do LOGS[name] end LOGS[name] # Initialize the log end |
#default ⇒ Object
35 |
# File 'lib/qlg.rb', line 35 def default; DEFAULT; end |