Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 9201

Show
Ignore:
Timestamp:
04/01/08 19:16:55 (3 months ago)
Author:
david
Message:

Use class << self

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/railties/lib/initializer.rb

    r9180 r9201  
    1414 
    1515module Rails 
    16   # The Configuration instance used to configure the Rails environment 
    17   def self.configuration 
    18     @@configuration 
    19   end 
     16  class << self 
     17    # The Configuration instance used to configure the Rails environment 
     18    def configuration 
     19      @@configuration 
     20    end 
    2021   
    21   def self.configuration=(configuration) 
    22     @@configuration = configuration 
    23   end 
     22    def configuration=(configuration) 
     23      @@configuration = configuration 
     24    end 
    2425   
    25   def self.logger 
    26     RAILS_DEFAULT_LOGGER 
    27   end 
     26    def logger 
     27      RAILS_DEFAULT_LOGGER 
     28    end 
    2829   
    29   def self.root 
    30     RAILS_ROOT 
    31   end 
     30    def root 
     31      RAILS_ROOT 
     32    end 
    3233   
    33   def self.env 
    34     RAILS_ENV 
    35   end 
     34    def env 
     35      RAILS_ENV 
     36    end 
    3637   
    37   def self.cache 
    38     RAILS_CACHE 
     38    def cache 
     39      RAILS_CACHE 
     40    end 
    3941  end 
    4042