lib/rake-commander/base/class_inheritable.rb in rake-commander-0.2.4 vs lib/rake-commander/base/class_inheritable.rb in rake-commander-0.2.5
- old
+ new
@@ -48,25 +48,25 @@
super.tap do
inheritable_class_var.each do |method, definitions|
definitions.each do |var, action|
instance_var = instance_variable_name(var)
value = instance_variable_get(instance_var)
- child_value = inherited_class_value(value, method, action)
+ child_value = inherited_class_value(value, method, action, subclass)
subclass.instance_variable_set(instance_var, child_value)
end
end
end
end
# @return [Variant] the value that the child class will inherit
- def inherited_class_value(value, method, action)
+ def inherited_class_value(value, method, action, subclass)
case method
when :mirror
value
when :deep_dup
case action
when Proc
- action.call(value)
+ action.call(value, subclass)
when :default
custom_deep_dup(value)
end
end
end