开发者

Problem with Ruby Documentation

I am new with Ruby and I don't understand ruby Documentation.I cut a piece of ruby documentation开发者_如何转开发. please explain completely this piece. thanks

Problem with Ruby Documentation


These are signatures of File#open method. As Ruby doesn't support method overloading, there is just one such method, but accepting different combinations of arguments (and potentially returning different things).

And to clarify the syntax, the first form in your screenshot:

open(filename, mode='r'[, opt]) -> file

means that the first form of File#open method expects following arguments:

  • filename (mandatory)
  • mode (optional, with default value 'r')
  • opt (probably a hash supporting different additional options)

and that it returns a file object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜