R
Raj Singh
This works.
class Person
def hi(inputproc)
inputproc.call
end
end
Person.new.hi lambda { puts 'wow1'; puts 'wow2'}
However when I try to split the code inside block in multiple line the
code does NOT work anymore.
This does NOT work.
class Person
def hi(inputproc)
inputproc.call
end
end
Person.new.hi lambda do
puts 'wow1'
puts 'wow2'
end
How do I create a proc consisting of multiple lines of code.
class Person
def hi(inputproc)
inputproc.call
end
end
Person.new.hi lambda { puts 'wow1'; puts 'wow2'}
However when I try to split the code inside block in multiple line the
code does NOT work anymore.
This does NOT work.
class Person
def hi(inputproc)
inputproc.call
end
end
Person.new.hi lambda do
puts 'wow1'
puts 'wow2'
end
How do I create a proc consisting of multiple lines of code.