123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Defined in: railties/lib/rails/railtie/configurable.rb

Instance Attribute Summary

Instance Method Summary

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(*args, &block) (protected)

[ GitHub ]

  
# File 'railties/lib/rails/railtie/configurable.rb', line 29

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

Instance Attribute Details

#config (readonly)

[ GitHub ]

  
# File 'railties/lib/rails/railtie/configurable.rb', line 9

delegate :config, to: :instance

Instance Method Details

#configure(&block)

[ GitHub ]

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

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

#inherited(base)

[ GitHub ]

  
# File 'railties/lib/rails/railtie/configurable.rb', line 11

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

#instance

[ GitHub ]

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

def instance
  @instance ||= new
end

#respond_to?(*args) ⇒ Boolean

[ GitHub ]

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

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