Sha256: ced1ce125a2800b2e153a6cb1f0ead1044bc088348fb2888369a6bc09ea2eb95

Contents?: true

Size: 308 Bytes

Versions: 15

Compression:

Stored size: 308 Bytes

Contents

module Polyfill
  module V2_4
    module Object
      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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
polyfill-1.9.0 lib/polyfill/v2_4/object.rb
polyfill-1.8.0 lib/polyfill/v2_4/object.rb
polyfill-1.7.0 lib/polyfill/v2_4/object.rb
polyfill-1.6.0 lib/polyfill/v2_4/object.rb
polyfill-1.5.0 lib/polyfill/v2_4/object.rb
polyfill-1.4.0 lib/polyfill/v2_4/object.rb
polyfill-1.3.0 lib/polyfill/v2_4/object.rb
polyfill-1.2.0 lib/polyfill/v2_4/object.rb
polyfill-1.1.0 lib/polyfill/v2_4/object.rb
polyfill-1.0.1 lib/polyfill/v2_4/object.rb
polyfill-1.0.0 lib/polyfill/v2_4/object.rb
polyfill-0.10.0 lib/polyfill/v2_4/object.rb
polyfill-0.9.0 lib/polyfill/v2_4/object.rb
polyfill-0.8.0 lib/polyfill/v2_4/object.rb
polyfill-0.7.0 lib/polyfill/v2_4/object.rb