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

#==, #each, #inheritable_copy, #initialize, #inspect, #key?, #overridden?, #pretty_print, #to_a, #to_h, #to_s

Methods inherited from OrderedOptions

#[], #[]=, #dig, #extractable_options?, #inspect, #method_missing, #respond_to_missing?

Methods inherited from Hash

#as_json, #assert_valid_keys, #compact_blank, #compact_blank!, #deep_dup, #deep_merge?, #deep_stringify_keys, #deep_stringify_keys!, #deep_symbolize_keys, #deep_symbolize_keys!, #deep_transform_keys, #deep_transform_keys!, #deep_transform_values, #deep_transform_values!, #except!, #extract!, #extractable_options?, from_trusted_xml, from_xml, #present?, #reverse_merge, #reverse_merge!, #slice!, #stringify_keys, #stringify_keys!, #symbolize_keys, #symbolize_keys!, #to_query, #to_xml, #with_indifferent_access

Methods included from DeepMergeable

#deep_merge, #deep_merge!, #deep_merge?

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.



20
21
22
23
24
25
26
# File 'lib/active_support/configurable.rb', line 20

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



15
16
17
# File 'lib/active_support/configurable.rb', line 15

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