38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/httparty/module_inheritable_attributes.rb', line 38
def inherited(subclass)
super
@mattr_inheritable_attrs.each do |inheritable_attribute|
ivar = :"@#{inheritable_attribute}"
subclass.instance_variable_set(ivar, instance_variable_get(ivar).clone)
if instance_variable_get(ivar).respond_to?(:merge)
subclass.class_eval " def self.\#{inheritable_attribute}\n duplicate = ModuleInheritableAttributes.hash_deep_dup(\#{ivar})\n \#{ivar} = superclass.\#{inheritable_attribute}.merge(duplicate)\n end\n RUBY\n end\n end\nend\n", __FILE__, __LINE__ + 1
|