From d994b41a05d650cffe441de04754cfbe8fc79c9a Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 30 Sep 2005 07:14:37 +0000 Subject: Added method access to OrdredOptions git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2422 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/ordered_options.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/ordered_options.rb b/activesupport/lib/active_support/ordered_options.rb index 3952ba41f2..5cd7fdadd7 100644 --- a/activesupport/lib/active_support/ordered_options.rb +++ b/activesupport/lib/active_support/ordered_options.rb @@ -15,6 +15,14 @@ class OrderedOptions < Array pair ? pair.last : nil end + def method_missing(name, *args) + if name.to_s =~ /(.*)=$/ + self[$1.to_sym] = args.first + else + self[name] + end + end + private def find_pair(key) self.each { |i| return i if i.first == key } -- cgit v1.2.3