Class: OrderedOptions

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ActiveSupport::OrderedHash

#delete, #keys, #to_hash, #values

Methods included from ActiveSupport::CoreExtensions::Array::RandomAccess

#rand

Methods included from ActiveSupport::CoreExtensions::Array::Grouping

#in_groups_of, #split

Methods included from ActiveSupport::CoreExtensions::Array::ExtractOptions

#extract_options!

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

included, #to_formatted_s, #to_param, #to_query, #to_sentence, #to_xml

Methods included from ActiveSupport::CoreExtensions::Array::Access

#from, #to

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/active_support/ordered_options.rb', line 10

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



6
7
8
# File 'lib/active_support/ordered_options.rb', line 6

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

#[]=(key, value) ⇒ Object



2
3
4
# File 'lib/active_support/ordered_options.rb', line 2

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