diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-09-21 22:49:20 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-09-21 22:49:20 +0530 |
commit | 3b7947ea31489afd020419e3c22ee01ce4809103 (patch) | |
tree | 447a5e56657c457a55004fc445699cfa581d625b /activesupport/lib/active_support/ordered_options.rb | |
parent | f74ddc8a4c748c3fb8ae7e03a5a211f87c025182 (diff) | |
parent | 7c0e3b87efca780b086ff0c458fa78a6db444b4c (diff) | |
download | rails-3b7947ea31489afd020419e3c22ee01ce4809103.tar.gz rails-3b7947ea31489afd020419e3c22ee01ce4809103.tar.bz2 rails-3b7947ea31489afd020419e3c22ee01ce4809103.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
actionmailer/lib/action_mailer/base.rb
activesupport/lib/active_support/configurable.rb
activesupport/lib/active_support/core_ext/module/deprecation.rb
guides/source/action_controller_overview.md
guides/source/active_support_core_extensions.md
guides/source/ajax_on_rails.textile
guides/source/association_basics.textile
guides/source/upgrading_ruby_on_rails.md
While resolving conflicts, I have chosen to ignore changes done in
docrails at some places - these will be most likely 1.9 hash syntax
changes.
Diffstat (limited to 'activesupport/lib/active_support/ordered_options.rb')
-rw-r--r-- | activesupport/lib/active_support/ordered_options.rb | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index 60e6cd55ad..c9518bda79 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -1,20 +1,19 @@ -# Usually key value pairs are handled something like this: -# -# h = {} -# h[:boy] = 'John' -# h[:girl] = 'Mary' -# h[:boy] # => 'John' -# h[:girl] # => 'Mary' -# -# Using <tt>OrderedOptions</tt>, the above code could be reduced to: -# -# h = ActiveSupport::OrderedOptions.new -# h.boy = 'John' -# h.girl = 'Mary' -# h.boy # => 'John' -# h.girl # => 'Mary' -# -module ActiveSupport #:nodoc: +module ActiveSupport + # Usually key value pairs are handled something like this: + # + # h = {} + # h[:boy] = 'John' + # h[:girl] = 'Mary' + # h[:boy] # => 'John' + # h[:girl] # => 'Mary' + # + # Using +OrderedOptions+, the above code could be reduced to: + # + # h = ActiveSupport::OrderedOptions.new + # h.boy = 'John' + # h.girl = 'Mary' + # h.boy # => 'John' + # h.girl # => 'Mary' class OrderedOptions < Hash alias_method :_get, :[] # preserve the original #[] method protected :_get # make it protected |