2009-03-29 02:53:04 -04:00
|
|
|
require 'active_support/ordered_hash'
|
|
|
|
|
2008-06-03 14:32:53 -04:00
|
|
|
module ActiveSupport #:nodoc:
|
2009-03-29 02:53:04 -04:00
|
|
|
class OrderedOptions < OrderedHash
|
2008-06-03 14:32:53 -04:00
|
|
|
def []=(key, value)
|
|
|
|
super(key.to_sym, value)
|
|
|
|
end
|
2006-05-31 18:43:53 -04:00
|
|
|
|
2008-06-03 14:32:53 -04:00
|
|
|
def [](key)
|
|
|
|
super(key.to_sym)
|
|
|
|
end
|
2006-02-25 18:06:04 -05:00
|
|
|
|
2008-06-03 14:32:53 -04:00
|
|
|
def method_missing(name, *args)
|
|
|
|
if name.to_s =~ /(.*)=$/
|
|
|
|
self[$1.to_sym] = args.first
|
|
|
|
else
|
|
|
|
self[name]
|
|
|
|
end
|
2006-02-25 18:06:04 -05:00
|
|
|
end
|
|
|
|
end
|
2006-05-31 18:43:53 -04:00
|
|
|
end
|