class RuboCop::AST::AndNode

A node extension for `until` nodes. This will be used in place of a plain node when the builder constructs the AST, making its methods available to all `until` nodes within RuboCop.

Public Instance Methods

alternate_operator() click to toggle source

Returns the alternate operator of the `and` as a string. Returns `and` for `&&` and vice versa.

@return [String] the alternate of the `and` operator

# File lib/rubocop/ast/node/and_node.rb, line 16
def alternate_operator
  logical_operator? ? SEMANTIC_AND : LOGICAL_AND
end
inverse_operator() click to toggle source

Returns the inverse keyword of the `and` node as a string. Returns `||` for `&&` and `or` for `and`.

@return [String] the inverse of the `and` operator

# File lib/rubocop/ast/node/and_node.rb, line 24
def inverse_operator
  logical_operator? ? LOGICAL_OR : SEMANTIC_OR
end