Class: Hash
- Inherits:
-
Object
show all
- Defined in:
- lib/webdriver-user-agent/core_ext/hash.rb
Constant Summary
collapse
- DEEP_SYMBOLIZE_KEYS_SYMBOLS =
[:deep_symbolize_keys, :deep_symbolize_keys!].freeze
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
8
9
10
11
12
|
# File 'lib/webdriver-user-agent/core_ext/hash.rb', line 8
def method_missing(sym, *args)
super unless DEEP_SYMBOLIZE_KEYS_SYMBOLS.include?(sym)
self.send("alias_#{sym}")
end
|
Instance Method Details
#deep_copy ⇒ Object
4
5
6
|
# File 'lib/webdriver-user-agent/core_ext/hash.rb', line 4
def deep_copy
Marshal.load(Marshal.dump(self))
end
|