def test
  yield
end

test do
  p "a"
end

i don`t know how yield function does in detail. why did i write yield
and then the p 'a' works? i know that it is a Proc object , but i
don`t know how it works. Is Proc do as a parameter?
test do
  p "a"
end
and is this code which makes the output?
thanks a lot.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to