Class: OrderedOptions

Inherits:
OrderedHash show all
Defined in:
lib/active_support/ordered_options.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from OrderedHash

#keys

Methods inherited from Array

#in_groups_of

Methods included from ActiveSupport::CoreExtensions::Array::Conversions

#to_param, #to_sentence, #to_xml

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/active_support/ordered_options.rb', line 36

def method_missing(name, *args)
  if name.to_s =~ /(.*)=$/
    self[$1.to_sym] = args.first
  else
    self[name]
  end
end

Instance Method Details

#[](key) ⇒ Object



32
33
34
# File 'lib/active_support/ordered_options.rb', line 32

def [](key)
  super(key.to_sym)
end

#[]=(key, value) ⇒ Object



28
29
30
# File 'lib/active_support/ordered_options.rb', line 28

def []=(key, value)
  super(key.to_sym, value)
end