123456789_123456789_123456789_123456789_123456789_

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

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#logical_operator?Boolean (readonly)

Checks whether this is a logical operator.

Returns:

  • (Boolean)

    whether this is a logical operator

[ GitHub ]

  
# 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.

Returns:

  • (Boolean)

    whether this is a semantic operator

[ GitHub ]

  
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 39

def semantic_operator?
  SEMANTIC_OPERATORS.include?(operator)
end

Instance Method Details

#operatorString

Returns the operator as a string.

Returns:

  • (String)

    the operator

[ GitHub ]

  
# File 'lib/rubocop/ast/node/mixin/predicate_operator_node.rb', line 25

def operator
  loc.operator.source
end