class RuboCop::Cop::InternalAffairs::NodeDestructuring
Checks that node destructuring is using the node extensions.
@example Using splat expansion
# bad _receiver, method_name, _arguments = send_node.children # bad _receiver, method_name, _arguments = *send_node # good method_name = send_node.method_name
Constants
- MSG
Public Instance Methods
Source
# File lib/rubocop/cop/internal_affairs/node_destructuring.rb, line 32 def on_masgn(node) node_destructuring?(node) { add_offense(node) } end
Private Instance Methods
Source
# File lib/rubocop/cop/internal_affairs/node_destructuring.rb, line 38 def node_suffix?(method_name) method_name.to_s.end_with?('node') end