diff options
author | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-09-17 00:12:11 -0500 |
---|---|---|
committer | Francesco Rodriguez <lrodriguezsanc@gmail.com> | 2012-09-17 00:12:11 -0500 |
commit | c1c9f1c7b98eb219eda01f8ddaef7aa2ab710b9f (patch) | |
tree | c36a4e8c05f6c0a5096d35f6db5a4eb741003e99 /activesupport/lib | |
parent | 744b8e0f35db6acd738f0b0619765facb9c546f1 (diff) | |
download | rails-c1c9f1c7b98eb219eda01f8ddaef7aa2ab710b9f.tar.gz rails-c1c9f1c7b98eb219eda01f8ddaef7aa2ab710b9f.tar.bz2 rails-c1c9f1c7b98eb219eda01f8ddaef7aa2ab710b9f.zip |
fix AS::OrderedOptions documentation [ci skip]
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/ordered_options.rb | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index 60e6cd55ad..5b44b9ed99 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: + # 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' class OrderedOptions < Hash alias_method :_get, :[] # preserve the original #[] method protected :_get # make it protected |