Sha256: 26c1fa5b0ebe5c2de0dcac82175239a66c96b8bc43f5e9b3f87dd8a3768d03fb

Contents?: true

Size: 338 Bytes

Versions: 4

Compression:

Stored size: 338 Bytes

Contents

require 'facets/proc/bind'

unless (RUBY_VERSION[0,3] == '1.9')

  module Kernel

    # Like instance_eval but allows parameters to be passed.
    #
    # NOTE: This is deprecated b/c implementation is fragile.
    # Use Ruby 1.9 instead.

    def instance_exec(*arguments, &block)
      block.bind(self)[*arguments]
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facets-2.4.0 lib/facets/kernel/instance_exec.rb
facets-2.4.1 lib/facets/kernel/instance_exec.rb
facets-2.4.2 lib/core/facets/kernel/instance_exec.rb
facets-2.4.3 lib/core/facets/kernel/instance_exec.rb