Module: RuboCop::AST::PredicateOperatorNode
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/rubocop/ast/node/mixin/predicate_operator_node.rb |
Overview
Common functionality for nodes that are predicates:
or
, and
…
Constant Summary
-
LOGICAL_AND =
private
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 8'&&'
-
LOGICAL_OPERATORS =
private
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 17[LOGICAL_AND, LOGICAL_OR].freeze
-
LOGICAL_OR =
private
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 12'||'
-
SEMANTIC_AND =
private
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 10'and'
-
SEMANTIC_OPERATORS =
private
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 19[SEMANTIC_AND, SEMANTIC_OR].freeze
-
SEMANTIC_OR =
private
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 14'or'
Instance Attribute Summary
-
#logical_operator? ⇒ Boolean
readonly
Checks whether this is a logical operator.
-
#semantic_operator? ⇒ Boolean
readonly
Checks whether this is a semantic operator.
Instance Method Summary
-
#operator ⇒ String
Returns the operator as a string.
Instance Attribute Details
#logical_operator? ⇒ Boolean
(readonly)
Checks whether this is a logical operator.
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 32
def logical_operator? LOGICAL_OPERATORS.include?(operator) end
#semantic_operator? ⇒ Boolean
(readonly)
Checks whether this is a semantic operator.
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 39
def semantic_operator? SEMANTIC_OPERATORS.include?(operator) end
Instance Method Details
#operator ⇒ String
Returns the operator as a string.
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 25
def operator loc.operator.source end