2010-01-23 12:41:53 -05:00
|
|
|
module Rails
|
|
|
|
class Railtie
|
|
|
|
module Configurable
|
|
|
|
def self.included(base)
|
|
|
|
base.extend ClassMethods
|
|
|
|
end
|
|
|
|
|
|
|
|
module ClassMethods
|
2010-07-19 11:53:14 -04:00
|
|
|
delegate :config, :to => :instance
|
2010-01-23 12:41:53 -05:00
|
|
|
|
|
|
|
def inherited(base)
|
2010-07-19 11:53:14 -04:00
|
|
|
raise "You cannot inherit from a #{self.superclass.name} child"
|
2010-01-23 12:41:53 -05:00
|
|
|
end
|
|
|
|
|
2010-07-19 11:53:14 -04:00
|
|
|
def instance
|
|
|
|
@instance ||= new
|
|
|
|
end
|
|
|
|
|
|
|
|
def respond_to?(*args)
|
|
|
|
super || instance.respond_to?(*args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def configure(&block)
|
|
|
|
class_eval(&block)
|
|
|
|
end
|
|
|
|
|
|
|
|
protected
|
|
|
|
|
|
|
|
def method_missing(*args, &block)
|
|
|
|
instance.send(*args, &block)
|
|
|
|
end
|
2010-01-23 12:41:53 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|