Module: RuboCop::AST::PredicateOperatorNode
Overview
Common functionality for nodes that are predicates: ‘or`, `and` …
Instance Method Summary collapse
-
#logical_operator? ⇒ Boolean
Checks whether this is a logical operator.
-
#operator ⇒ String
Returns the operator as a string.
-
#semantic_operator? ⇒ Boolean
Checks whether this is a semantic operator.
Instance Method Details
#logical_operator? ⇒ Boolean
Checks whether this is a logical operator.
32 33 34 |
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 32 def logical_operator? LOGICAL_OPERATORS.include?(operator) end |
#operator ⇒ String
Returns the operator as a string.
25 26 27 |
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 25 def operator loc.operator.source end |
#semantic_operator? ⇒ Boolean
Checks whether this is a semantic operator.
39 40 41 |
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 39 def semantic_operator? SEMANTIC_OPERATORS.include?(operator) end |