class SyntaxTree::Database::TypeQuery

Query for a specific type of node.

Attributes

type[R]

Public Class Methods

new(type) click to toggle source
# File lib/syntax_tree/database.rb, line 88
def initialize(type)
  @type = type
end

Public Instance Methods

each(database, &block) click to toggle source
# File lib/syntax_tree/database.rb, line 92
def each(database, &block)
  sql = "SELECT * FROM nodes WHERE type = ?"
  database.execute(sql, type).each(&block)
end