Class: GitlabZOQL::Parser::Statement::Node
- Inherits:
-
Object
- Object
- GitlabZOQL::Parser::Statement::Node
show all
- Defined in:
- lib/gitlab-zoql/parser/statement.rb
Direct Known Subclasses
ComparisonPredicate, DirectSelect, False, FromClause, Identifier, Literal, Null, SearchCondition, Select, SelectList, TableExpression, True, Unary, WhereClause
Instance Method Summary
collapse
Instance Method Details
#accept(visitor) ⇒ Object
5
6
7
8
9
10
11
12
13
|
# File 'lib/gitlab-zoql/parser/statement.rb', line 5
def accept(visitor)
klass = self.class.ancestors.find do |ancestor|
visitor.respond_to?("visit_#{demodulize(ancestor.name)}")
end
raise "No visitor for #{self.class.name}" unless klass
visitor.__send__("visit_#{demodulize(klass.name)}", self)
end
|