class RuboCop::AST::UntilNode

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

do?() click to toggle source

Checks whether the `until` node has a `do` keyword.

@return [Boolean] whether the `until` node has a `do` keyword

# File lib/rubocop/ast/node/until_node.rb, line 30
def do?
  loc.begin&.is?('do')
end
inverse_keyword() click to toggle source

Returns the inverse keyword of the `until` node as a string. Returns `while` for `until` nodes and vice versa.

@return [String] the inverse keyword of the `until` statement

# File lib/rubocop/ast/node/until_node.rb, line 23
def inverse_keyword
  'while'
end
keyword() click to toggle source

Returns the keyword of the `until` statement as a string.

@return [String] the keyword of the `until` statement

# File lib/rubocop/ast/node/until_node.rb, line 15
def keyword
  'until'
end