Class: Rails::Application::Configuration::Custom

Inherits:
Object
  • Object
show all
Defined in:
railties/lib/rails/application/configuration.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeCustom

Returns a new instance of Custom.


493
494
495
# File 'railties/lib/rails/application/configuration.rb', line 493

def initialize
  @configurations = Hash.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object


497
498
499
500
501
502
503
504
505
# File 'railties/lib/rails/application/configuration.rb', line 497

def method_missing(method, *args)
  if method.end_with?("=")
    @configurations[:"#{method[0..-2]}"] = args.first
  else
    @configurations.fetch(method) {
      @configurations[method] = ActiveSupport::OrderedOptions.new
    }
  end
end

Instance Method Details

#respond_to_missing?(symbol) ⇒ Boolean

Returns:

  • (Boolean)

507
508
509
# File 'railties/lib/rails/application/configuration.rb', line 507

def respond_to_missing?(symbol, *)
  true
end