I like ruby the first time I read its document.
However then I found that the syntax is too fliexible to learn it.
The IO.open method,this is the api page:
This is the argument of this method:
new(fd [, mode] [, opt])
I am confused by the third argument-‘opt’.
Is its type is ‘hash’??
If so I think this is the way to call it:
But I found so many people call it like this:
IO.new(“data.txt”, mode: ‘w:UTF-16LE’, cr_newline: true)
What does this mean?
‘data.txt’ is the first argument. How about the others? which is the
second? and which is the third?