class Pry::Code::LOC

Represents a line of code (which may, in fact, contain multiple lines if the entirety was eval’d as a single unit following the ‘edit` command).

A line of code is a tuple, which consists of a line and a line number. A ‘LOC` object’s state (namely, the line parameter) can be changed via instance methods. ‘Pry::Code` heavily uses this class.

@api private @example

loc = LOC.new("def example\n  :example\nend", 1)
puts loc.line
def example
  :example
end
#=> nil

loc.indent(3)
loc.line #=> "   def example\n  :example\nend"