saasbook

block_example_3.rb

Aug 15th, 2013
243
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!! ===
Add Comment
Please, Sign In to add comment