Class: Alf::Engine::Leaf

Inherits:
Object
  • Object
show all
Includes:
Cog
Defined in:
lib/alf/engine/leaf.rb

Overview

Marker for leaf compiled nodes

Constant Summary

Constants included from Cog

Cog::EMPTY_CHILDREN, Cog::EMPTY_OPTIONS

Instance Attribute Summary collapse

Attributes included from Compiler::Cog

#compiler, #expr

Instance Method Summary collapse

Methods included from Cog

#arguments, #children, #each, #options

Methods included from Compiler::Cog

#cog_orders, #orderedby?, #relation_type, #to_ascii_tree, #to_cog, #to_relation

Constructor Details

#initialize(operand, expr = nil, compiler = nil) ⇒ Leaf

Creates a Concat instance


13
14
15
16
# File 'lib/alf/engine/leaf.rb', line 13

def initialize(operand, expr = nil, compiler = nil)
  super(expr, compiler)
  @operand = operand
end

Instance Attribute Details

#operandObject (readonly)

The initial expression


10
11
12
# File 'lib/alf/engine/leaf.rb', line 10

def operand
  @operand
end

Instance Method Details

#_eachObject


19
20
21
22
23
# File 'lib/alf/engine/leaf.rb', line 19

def _each
  operand.each do |tuple|
    yield(symbolize(tuple))
  end
end

#inspectObject


29
30
31
# File 'lib/alf/engine/leaf.rb', line 29

def inspect
  "Engine::Leaf(#{operand.inspect})"
end

#to_sObject


25
26
27
# File 'lib/alf/engine/leaf.rb', line 25

def to_s
  "Leaf"
end