Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def call
- tries ||= 0
- begin
- puts("#{tries} try")
- yield(tries)
- rescue
- retry if (tries += 1) < 4
- puts("i tried...#{tries} times")
- end
- end
- call do |tries|
- p("block call #{tries}")
- end
- call do
- raise
- end
Add Comment
Please, Sign In to add comment