lib/polyfill/v2_4/object.rb in polyfill-0.6.0 vs lib/polyfill/v2_4/object.rb in polyfill-0.7.0

- old
+ new

@@ -1,9 +1,15 @@ -require_relative 'object/instance' - module Polyfill module V2_4 module Object - include Instance + def clone(freeze: true) + return super() if freeze + + cloned = dup + (singleton_class.ancestors - self.class.ancestors).drop(1).each do |ancestor| + cloned.extend(ancestor) + end + cloned + end end end end