Skip to content
代码片段 群组 项目
提交 223f096e 编辑于 作者: Peter Leitzen's avatar Peter Leitzen 提交者: Stan Hu
浏览文件

Fix code docs for RuboCop's helper methods

`(const nil :Foo)` vs `(const nil? :Foo)`
上级 19289323
No related branches found
No related tags found
无相关合并请求
......@@ -25,7 +25,7 @@ def file_path_for_node(node)
# Returns the name of a constant node.
#
# Given the AST node `(const nil :Foo)`, this method will return `:Foo`.
# Given the AST node `(const nil? :Foo)`, this method will return `:Foo`.
def name_of_constant(node)
node.children[1]
end
......@@ -87,7 +87,7 @@ def in_directory?(node, directory)
# Returns the receiver name of a send node.
#
# For the AST node `(send (const nil :Foo) ...)` this would return
# For the AST node `(send (const nil? :Foo) ...)` this would return
# `'Foo'`.
def name_of_receiver(node)
name_of_constant(node.children.first).to_s
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册