tag:blogger.com,1999:blog-1559831790779967841.post8037864101000855977..comments2023-05-25T16:13:35.829+02:00Comments on blog.ant0i.net - my little techie blog: Seven Languages in Seven Weeks - Ruby Day 2 Self-Studyantoinethttp://www.blogger.com/profile/11659661081559039635noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-1559831790779967841.post-58237332199079227262012-03-10T00:17:37.834+01:002012-03-10T00:17:37.834+01:00Hey Antoinet :).
The file with block form should ...Hey Antoinet :).<br /><br />The file with block form should actually be used like this:<br /><br /> File.open("hello.txt") do |file|<br /> file.each { |line| puts line }<br /> end<br /><br />This ensures that the file is closed at the end of the block, which is not the case in your example.<br /><br />Regarding Hash to Array, simply use hash.to_a :).<br /><br />By the way, see here if you're interested in my solutions:<br /><br />https://github.com/robinst/7langs7weeksRobinhttps://www.blogger.com/profile/06879404124410084000noreply@blogger.com