Module: HTTParty::ModuleInheritableAttributes

Defined in:
lib/httparty/module_inheritable_attributes.rb

Overview

:nodoc:

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Class Method Details

.hash_deep_dup(h) ⇒ Object

borrowed from Rails 3.2 ActiveSupport



8
9
10
11
12
13
14
15
# File 'lib/httparty/module_inheritable_attributes.rb', line 8

def self.hash_deep_dup(h)
  duplicate = h.dup
  duplicate.each_pair do |k,v|
    tv = duplicate[k]
    duplicate[k] = tv.is_a?(Hash) && v.is_a?(Hash) ? hash_deep_dup(tv) : v
  end
  duplicate
end

.included(base) ⇒ Object



3
4
5
# File 'lib/httparty/module_inheritable_attributes.rb', line 3

def self.included(base)
  base.extend(ClassMethods)
end