Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.14 KB | None | 0 0
  1. def test(list)
  2.   print "Not valid" unless list.all? { |x| x[1] == ("R"||"S")  }
  3. end
  4.  
  5. list = [ [ "Apple", "R" ], [ "Banana", "S" ] ]
  6. test(list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement