Module: RuboCop::Cop::AccessModifierNode

Extended by:
AST::Sexp
Included in:
Lint::UselessAccessModifier, Style::AccessModifierIndentation, Style::EmptyLinesAroundAccessModifier, Style::IndentationConsistency, Style::IndentationWidth
Defined in:
lib/rubocop/cop/mixin/access_modifier_node.rb

Overview

Common functionality for checking modifier nodes.

Constant Summary collapse

PRIVATE_NODE =
s(:send, nil, :private)
PROTECTED_NODE =
s(:send, nil, :protected)
PUBLIC_NODE =
s(:send, nil, :public)
MODUDULE_FUNCTION_NODE =
s(:send, nil, :module_function)

Instance Method Summary collapse

Instance Method Details

#modifier_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/rubocop/cop/mixin/access_modifier_node.rb', line 14

def modifier_node?(node)
  [PRIVATE_NODE,
   PROTECTED_NODE,
   PUBLIC_NODE,
   MODUDULE_FUNCTION_NODE].include?(node)
end