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 OrderedOptions, 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 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