Skip to content
On this page

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class · Ruby 3.2

SyntaxSuggest::BlockExpand

< Object 4 instance methods 1 class methods

This class is responsible for taking a code block that exists at a far indentaion and then iteratively increasing the block so that it captures everything within the same indentation block.

Example
def dog
  puts "bow"
  puts "wow"
end

block = BlockExpand.new(code_lines: code_lines)

.call(CodeBlock.new(lines: code_lines[1]))

puts block.to_s # => puts “bow”

Example
puts "wow"

Once a code block has captured everything at a given indentation level then it will expand to capture surrounding indentation.

block = BlockExpand.new(code_lines: code_lines)

.call(block)

block.to_s # => def dog

  puts "bow"
  puts "wow"
end

Class methods 1

Instance methods 4