“下划线”\“散列”是RDoc 中的含义
我正在使用 Ruby on Rails 3.0.7,我试图了解 RDoc 系统的工作原理。所以我想了解当官方文档在线引用时“哈希”值意味着什么7:
- 类的名称、源文件以及任何包含 下划线或前面有散列 字符是自动的 从评论文本到他们的超链接 描述。
你能给我一个在我的注释代码中说明这一点的例子吗?您对使用它有什么建议吗?
顺便说一句:您有引用 RDoc 的“必须阅读”资源吗?如果有的话,你能提供一下吗?
I am using Ruby on Rails 3.0.7 and I am trying to understand how the RDoc system works. So I would like to understand what the "hash" value means when the official documentation refers to that on line 7:
- Names of classes, source files, and any method names containing an
underscore or preceded by a hash
character are automatically
hyperlinked from comment text to their
description.
Can you make me an example of stating that in my commented code? Have you some advice about using that?
BTW: Do you have a "MUST READ" resource referring to RDoc? If so, can you provide that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它们的意思是
#
符号。当在文本中引用某个方法时,通常会在其前面添加一个哈希值。例如:“为了将数组转换为字符串,请调用#to_s”。现在,rdoc 将注意到哈希值并将其转换为方法
to_s
的文档链接。They mean the
#
symbol.When referring to a method in text, it is typical for you to prepend a hash to it. For example: "In order to convert array to a string, call #to_s". Now, rdoc will notice the hash and turn it into a link to the documentation for the method
to_s
.