开发者

Problem with Ruby Documentation

开发者 https://www.devze.com 2023-03-28 14:13 出处:网络
I am new with Ruby and I don\'t understand ruby Documentation.I cut a piece of ruby documentation开发者_如何转开发. please explain completely this piece.

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

精彩评论

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