Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> def each_file n
- >> n.each do
- ?> |name|
- ?> yield File.open name, 'r'
- >> end
- >> end
- => nil
- >> f
- => ["d2", "d3"]
- >> each_file f do
- ?> |file|
- ?> file.each do
- ?> |line|
- ?> puts line
- >> end
- >> end
- x
- xx
- yy
- yyyyyy
- => ["d2", "d3"]
- >>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement