class Querly::Script

Attributes

node[R]
path[R]

Public Class Methods

load(path:, source:) click to toggle source
# File lib/querly/script.rb, line 6
def self.load(path:, source:)
  parser = Parser::Ruby30.new(Builder.new).tap do |parser|
    parser.diagnostics.all_errors_are_fatal = true
    parser.diagnostics.ignore_warnings = true
  end
  buffer = Parser::Source::Buffer.new(path.to_s, 1)
  buffer.source = source
  self.new(path: path, node: parser.parse(buffer))
end
new(path:, node:) click to toggle source
# File lib/querly/script.rb, line 16
def initialize(path:, node:)
  @path = path
  @node = node
end

Public Instance Methods

root_pair() click to toggle source
# File lib/querly/script.rb, line 21
def root_pair
  NodePair.new(node: node)
end