Class: Hash

Inherits:
Object show all
Defined in:
lib/thread_storm/active_support.rb

Overview

Things I miss from active_support.

Instance Method Summary collapse

Instance Method Details

#option_merge(options) ⇒ Object



13
14
15
# File 'lib/thread_storm/active_support.rb', line 13

def option_merge(options)
  symbolize_keys.reverse_merge(options)
end

#reverse_merge(other) ⇒ Object



9
10
11
# File 'lib/thread_storm/active_support.rb', line 9

def reverse_merge(other)
  other.merge(self)
end

#symbolize_keysObject

:nodoc:



5
6
7
# File 'lib/thread_storm/active_support.rb', line 5

def symbolize_keys
  inject({}){ |memo, (k, v)| memo[k.to_sym] = v; memo }
end