J
Jeff
I happened to be reading dependencies.rb in the Rails source, and it
starts like this:
require 'set'
require File.dirname(__FILE__) + '/core_ext/module/attribute_accessors'
require File.dirname(__FILE__) + '/core_ext/load_error'
require File.dirname(__FILE__) + '/core_ext/kernel'
module Dependencies #:nodoc:
extend self
...
What is the "extend self" doing? I thought at the top a module, 'self'
was pretty much an empty context at that point... but I guess not,
since the writer obviously thinks self contains something worth
extending...?
Jeff
starts like this:
require 'set'
require File.dirname(__FILE__) + '/core_ext/module/attribute_accessors'
require File.dirname(__FILE__) + '/core_ext/load_error'
require File.dirname(__FILE__) + '/core_ext/kernel'
module Dependencies #:nodoc:
extend self
...
What is the "extend self" doing? I thought at the top a module, 'self'
was pretty much an empty context at that point... but I guess not,
since the writer obviously thinks self contains something worth
extending...?
Jeff