Class: ActiveSupport::Configurable::Configuration

Inherits:
InheritableOptions show all
Defined in:
lib/active_support/configurable.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from InheritableOptions

#inheritable_copy, #initialize

Methods inherited from OrderedOptions

#[], #[]=, #method_missing, #respond_to_missing?

Methods inherited from Hash

#as_json, #assert_valid_keys, #compact, #compact!, #deep_dup, #deep_merge, #deep_merge!, #deep_stringify_keys, #deep_stringify_keys!, #deep_symbolize_keys, #deep_symbolize_keys!, #deep_transform_keys, #deep_transform_keys!, #except, #except!, #extract!, #extractable_options?, from_trusted_xml, from_xml, #reverse_merge, #reverse_merge!, #slice, #slice!, #stringify_keys, #stringify_keys!, #symbolize_keys, #symbolize_keys!, #to_query, #to_xml, #transform_keys, #transform_keys!, #transform_values, #transform_values!, #with_indifferent_access

Constructor Details

This class inherits a constructor from ActiveSupport::InheritableOptions

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveSupport::OrderedOptions

Class Method Details

.compile_methods!(keys) ⇒ Object

Compiles reader methods so we don’t have to go through method_missing.



17
18
19
20
21
22
23
# File 'lib/active_support/configurable.rb', line 17

def self.compile_methods!(keys)
  keys.reject { |m| method_defined?(m) }.each do |key|
    class_eval <<-RUBY, __FILE__, __LINE__ + 1
      def #{key}; _get(#{key.inspect}); end
    RUBY
  end
end

Instance Method Details

#compile_methods!Object



12
13
14
# File 'lib/active_support/configurable.rb', line 12

def compile_methods!
  self.class.compile_methods!(keys)
end