Skip to content
Permalink
Browse files
don't use single letter variable names [ci skip]
  • Loading branch information
tak1n committed Feb 6, 2016
1 parent 7a8f1dc commit 161a78731d0abaa82cdb27b92b77ad743dbbd7fa
Showing 1 changed file with 7 additions and 7 deletions.
@@ -188,16 +188,16 @@ def cool_method
end
end

o = ProcFromMethod.new
o.data = :foo
object1 = ProcFromMethod.new
object1.data = :foo

p = o.method(:cool_method).to_proc
method_proc = object1.method(:cool_method).to_proc
klass = Class.new(ProcFromMethod)
klass.send(:define_method, :other_cool_method, p)
klass.send(:define_method, :other_cool_method, &method_proc)

object = klass.new
object.data = :bar
object.other_cool_method.should == "data is foo"
object2 = klass.new
object2.data = :bar
object2.other_cool_method.should == "data is foo"
end

it "maintains the Proc's scope" do

0 comments on commit 161a787

Please sign in to comment.