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

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initializeCustom

Returns a new instance of Custom.



449
450
451
# File 'lib/rails/application/configuration.rb', line 449

def initialize
  @configurations = Hash.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



453
454
455
456
457
458
459
460
461
# File 'lib/rails/application/configuration.rb', line 453

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)


463
464
465
# File 'lib/rails/application/configuration.rb', line 463

def respond_to_missing?(symbol, *)
  true
end