Class: Pluckr::Schema::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/pluckr/schema/node.rb

Overview

Base class for every AST node.

output is the key the node produces on the result object.

Direct Known Subclasses

Aggregate, Exists, Field, One

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output:) ⇒ Node

Returns a new instance of Node.



11
12
13
# File 'lib/pluckr/schema/node.rb', line 11

def initialize(output:)
  @output = output.to_sym
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



9
10
11
# File 'lib/pluckr/schema/node.rb', line 9

def output
  @output
end

Instance Method Details

#scalar?Boolean

Nodes that map to exactly one selected column/expression.

Returns:

  • (Boolean)


16
17
18
# File 'lib/pluckr/schema/node.rb', line 16

def scalar?
  true
end