Module: Rails::Railtie::Configurable::ClassMethods

Defined in:
railties/lib/rails/railtie/configurable.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) ⇒ Object (private)



30
31
32
# File 'railties/lib/rails/railtie/configurable.rb', line 30

def method_missing(*args, &block)
  instance.send(*args, &block)
end

Instance Method Details

#configure(&block) ⇒ Object



25
26
27
# File 'railties/lib/rails/railtie/configurable.rb', line 25

def configure(&block)
  class_eval(&block)
end

#inherited(base) ⇒ Object



13
14
15
# File 'railties/lib/rails/railtie/configurable.rb', line 13

def inherited(base)
  raise "You cannot inherit from a #{superclass.name} child"
end

#instanceObject



17
18
19
# File 'railties/lib/rails/railtie/configurable.rb', line 17

def instance
  @instance ||= new
end

#respond_to?(*args) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'railties/lib/rails/railtie/configurable.rb', line 21

def respond_to?(*args)
  super || instance.respond_to?(*args)
end