Method: Parser::Source::Buffer#source

Defined in:
lib/parser/source/buffer.rb

#sourceString

Source code contained in this buffer.

Returns:

  • (String)

    source code

Raises:

  • (RuntimeError)

    if buffer is not populated yet

[View source] [View on GitHub]

150
151
152
153
154
155
156
# File 'lib/parser/source/buffer.rb', line 150

def source
  if @source.nil?
    raise RuntimeError, 'Cannot extract source from uninitialized Source::Buffer'
  end

  @source
end