Sha256: 65281356c310241e8a45d2bea52920e15fb884623afcf1e4448490c934df46c5

Contents?: true

Size: 659 Bytes

Versions: 1

Compression:

Stored size: 659 Bytes

Contents

module DuckPuncher
  module Ducks
    module Object
      def clone!
        Marshal.load Marshal.dump self
      end unless defined? clone!

      def require!(file_or_gem, version = '')
        if DuckPuncher::GemInstaller.new.perform(file_or_gem, version)
          require file_or_gem.tr('-', '/')
        end
      end

      def punch(duck_name = self.class.name)
        DuckPuncher.delegate_class(duck_name.to_sym, self).new(self)
      end

      def track
        DuckPuncher.punch! :Object, only: :require! unless respond_to? :require!
        require! 'object_tracker'
        extend ::ObjectTracker
        track_all!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
duck_puncher-2.10.1 lib/duck_puncher/ducks/object.rb