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)

Instance Method Summary collapse

Instance Method Details

#modifier_node?(node) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/rubocop/cop/mixin/access_modifier_node.rb', line 13

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