summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Leitzen <pleitzen@gitlab.com>2019-09-11 23:01:49 +0200
committerPeter Leitzen <pleitzen@gitlab.com>2019-09-11 23:01:49 +0200
commit14ee8684bf5308ba43eeac0192ac574b2a9e709c (patch)
tree13def44f59ff1c04548351c600cd66c955294536
parent76c0af2917550626c7ae9373933f274d6b845e0e (diff)
downloadgitlab-ce-pl-rubocop-const-nil.tar.gz
Fix code docs for RuboCop's helper methodspl-rubocop-const-nil
`(const nil :Foo)` vs `(const nil? :Foo)`
-rw-r--r--rubocop/code_reuse_helpers.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/rubocop/code_reuse_helpers.rb b/rubocop/code_reuse_helpers.rb
index 0929a55d901..63019c43943 100644
--- a/rubocop/code_reuse_helpers.rb
+++ b/rubocop/code_reuse_helpers.rb
@@ -25,7 +25,7 @@ module RuboCop
# 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 @@ module RuboCop
# 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