123456789_123456789_123456789_123456789_123456789_

Class: ActiveSupport::Configurable::Configuration

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: ActiveSupport::InheritableOptions
Defined in: activesupport/lib/active_support/configurable.rb

Class Method Summary

::ActiveSupport::InheritableOptions - Inherited

::Hash - Inherited

.from_trusted_xml

Builds a ::Hash from XML just like Hash.from_xml, but also allows ::Symbol and YAML.

.from_xml

Returns a ::Hash containing a collection of pairs when the key is the node name and the value is its content.

Instance Attribute Summary

::Hash - Inherited

#extractable_options?

By default, only instances of ::Hash itself are extractable.

Instance Method Summary

::ActiveSupport::InheritableOptions - Inherited

::ActiveSupport::OrderedOptions - Inherited

::Hash - Inherited

#assert_valid_keys

Validate all keys in a hash match *valid_keys, raising ArgumentError on a mismatch.

#blank?

A hash is blank if it's empty:

#compact

Returns a hash with non nil values.

#compact!

Replaces current hash with non nil values.

#deep_dup

Returns a deep copy of hash.

#deep_merge

Returns a new hash with self and other_hash merged recursively.

#deep_merge!

Same as deep_merge, but modifies self.

#deep_stringify_keys

Returns a new hash with all keys converted to strings.

#deep_stringify_keys!

Destructively convert all keys to strings.

#deep_symbolize_keys

Returns a new hash with all keys converted to symbols, as long as they respond to to_sym.

#deep_symbolize_keys!

Destructively convert all keys to symbols, as long as they respond to to_sym.

#deep_transform_keys

Returns a new hash with all keys converted by the block operation.

#deep_transform_keys!

Destructively convert all keys by using the block operation.

#except

Returns a hash that includes everything but the given keys.

#except!

Replaces the hash without the given keys.

#extract!

Removes and returns the key/value pairs matching the given keys.

#nested_under_indifferent_access
#reverse_merge

Merges the caller into other_hash.

#reverse_merge!

Destructive reverse_merge.

#reverse_update
#slice

Slice a hash to include only the given keys.

#slice!

Replaces the hash with only the given keys.

#stringify_keys

Returns a new hash with all keys converted to strings.

#stringify_keys!

Destructively convert all keys to strings.

#symbolize_keys

Returns a new hash with all keys converted to symbols, as long as they respond to to_sym.

#symbolize_keys!

Destructively convert all keys to symbols, as long as they respond to to_sym.

#to_options
#to_options!
#to_param

Alias for Hash#to_query.

#to_query

Returns a string representation of the receiver suitable for use as a URL query string:

#to_xml

Returns a string containing an XML representation of its receiver:

#transform_keys

Returns a new hash with all keys converted using the block operation.

#transform_keys!

Destructively convert all keys using the block operations.

#transform_values

Returns a new hash with the results of running block once for every value.

#transform_values!

Destructive transform_values

#with_indifferent_access

Returns an ::ActiveSupport::HashWithIndifferentAccess out of its receiver:

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)

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

[ GitHub ]

  
# File 'activesupport/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!

[ GitHub ]

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

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