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.



525
526
527
# File 'railties/lib/rails/application/configuration.rb', line 525

def initialize
  @configurations = Hash.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



529
530
531
532
533
534
535
536
537
# File 'railties/lib/rails/application/configuration.rb', line 529

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)


539
540
541
# File 'railties/lib/rails/application/configuration.rb', line 539

def respond_to_missing?(symbol, *)
  true
end