saasbook

block_example_3.rb

May 1st, 2012
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.18 KB | None | 0 0
  1. movies.each do |m|
  2.   separator = '=>'  # first assignment is inside a block!
  3.   puts "#{m.title} #{separator} #{m.rating}"   #  OK
  4. end
  5. puts "Separator is #{separator}"     # === FAILS!! ===
Advertisement
Add Comment
Please, Sign In to add comment