Class: Norikra::Query::ASTSelectionElementNode

Inherits:
ASTNode
  • Object
show all
Defined in:
lib/norikra/query/ast.rb

Overview

SELECTION_ELEMENT_EXPR

Instance Attribute Summary

Attributes inherited from ASTNode

#children, #name

Instance Method Summary collapse

Methods inherited from ASTNode

#child, #fields, #find, #initialize, #listup, #to_a

Constructor Details

This class inherits a constructor from Norikra::Query::ASTNode

Instance Method Details

#aliasObject



181
182
183
# File 'lib/norikra/query/ast.rb', line 181

def alias
  @children.size == 2 ? @children[1].name : nil
end

#nodetype?(*sym) ⇒ Boolean

“count(*) AS cnt” => [“SELECTION_ELEMENT_EXPR”, “count”, “cnt”] “n.s as s” => [“SELECTION_ELEMENT_EXPR”, [“EVENT_PROP_EXPR”, [“EVENT_PROP_SIMPLE”, “n”], [“EVENT_PROP_SIMPLE”, “s”]], “s”]

Returns:



177
178
179
# File 'lib/norikra/query/ast.rb', line 177

def nodetype?(*sym)
  sym.include?(:selection)
end