Sha256: ff9df5fac403abcbfb236258b57cb5ee91ce7a0f11793463ac579a6f37e3f2fa

Contents?: true

Size: 357 Bytes

Versions: 8

Compression:

Stored size: 357 Bytes

Contents

class Proc

  def call_with_binding(bind, *args)
    Bindless.new([bind]).run_proc(self, *args)
  end

  def call_with_obj(obj, *args)
    m = nil
    p = self
    Object.class_eval do
      define_method :a_temp_method_name, &p
      m = instance_method :a_temp_method_name; remove_method :a_temp_method_name
    end
    m.bind(obj).call(*args)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
procemon-0.1.4 lib/procemon/function/meta/binding/proc.rb
procemon-0.1.3 lib/procemon/function/meta/binding/proc.rb
procemon-0.1.1 lib/procemon/function/meta/binding/proc.rb
procemon-0.0.9 lib/procemon/function/meta/binding/proc.rb
procemon-0.0.8 lib/procemon/function/meta/binding/proc.rb
procemon-0.0.7 lib/procemon/function/meta/binding/proc.rb
procemon-0.0.6 lib/procemon/function/meta/binding/proc.rb
procemon-0.0.5 lib/procemon/function/meta/binding/proc.rb