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.
27 28 29 |
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 27 def logical_operator? operator == LOGICAL_AND || operator == LOGICAL_OR end |
#operator ⇒ String
Returns the operator as a string.
20 21 22 |
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 20 def operator loc.operator.source end |
#semantic_operator? ⇒ Boolean
Checks whether this is a semantic operator.
34 35 36 |
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 34 def semantic_operator? operator == SEMANTIC_AND || operator == SEMANTIC_OR end |