Changes between Version 5 and Version 6 of SummaryRuby
- Timestamp:
- Nov 15, 2014, 3:57:09 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SummaryRuby
v5 v6 609 609 # by using File.open in a block, is not needed to close the file when finish 610 610 File.open("text.txt", "w") do |file| file.puts "Hi" end 611 # note that the next line is invalid, if you put a space before ( then is not an argument list what you pass to it612 #File.open ("text.txt", "w") do |file| file.puts "Hi" end613 611 614 612 # appending … … 621 619 puts f.hour # since the object returned (f) is a Time object, we can treat him as it 622 620 621 622 # 623 # Typos / Pitfails 624 # 625 626 # if you put a space before ( it is then not interpreted as arguments, ( needs to be always joint with the call 627 File.open ("text.txt", "w") 628 629 # if you put more than one space like here it is then interpreted as a(+b) 630 a + b 623 631 624 632