Class: ActiveSupport::Configurable::Configuration
- Inherits:
-
InheritableOptions
- Object
- Hash
- OrderedHash
- OrderedOptions
- InheritableOptions
- ActiveSupport::Configurable::Configuration
- Defined in:
- lib/active_support/configurable.rb
Class Method Summary collapse
-
.compile_methods!(keys) ⇒ Object
compiles reader methods so we don’t have to go through method_missing.
Instance Method Summary collapse
Methods inherited from InheritableOptions
#inheritable_copy, #initialize
Methods inherited from OrderedOptions
#[], #[]=, #method_missing, #respond_to?
Methods inherited from OrderedHash
[], #[]=, #clear, #delete, #delete_if, #each, #each_key, #each_pair, #each_value, #encode_with, #extractable_options?, #initialize, #initialize_copy, #inspect, #invert, #keys, #merge, #merge!, #nested_under_indifferent_access, #reject, #reject!, #replace, #shift, #to_a, #to_hash, #to_yaml, #to_yaml_type, #values
Methods inherited from Hash
#as_json, #assert_valid_keys, #deep_dup, #deep_merge, #deep_merge!, #diff, #encode_json, #except, #except!, #extract!, #extractable_options?, from_xml, #reverse_merge, #reverse_merge!, #slice, #slice!, #stringify_keys, #stringify_keys!, #symbolize_keys, #symbolize_keys!, #to_param, #to_xml, #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
19 20 21 22 23 24 25 |
# File 'lib/active_support/configurable.rb', line 19 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
14 15 16 |
# File 'lib/active_support/configurable.rb', line 14 def compile_methods! self.class.compile_methods!(keys) end |