Class: Alf::Sql::Processor::Join

Inherits:
Alf::Sql::Processor show all
Includes:
JoinSupport
Defined in:
lib/alf/sql/processor/join.rb

Constant Summary

Constants inherited from Alf::Sql::Processor

UnexpectedError

Instance Attribute Summary collapse

Attributes inherited from Alf::Sql::Processor

#builder

Instance Method Summary collapse

Methods included from JoinSupport

#on_main_exp

Methods inherited from Alf::Sql::Processor

#on_select_exp, #on_set_operator, #on_with_exp

Constructor Details

#initialize(right, builder) ⇒ Join

Returns a new instance of Join.



7
8
9
10
# File 'lib/alf/sql/processor/join.rb', line 7

def initialize(right, builder)
  super(builder)
  @right = right
end

Instance Attribute Details

#rightObject (readonly)

Returns the value of attribute right.



11
12
13
# File 'lib/alf/sql/processor/join.rb', line 11

def right
  @right
end

Instance Method Details

#call(sexpr) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/alf/sql/processor/join.rb', line 13

def call(sexpr)
  if unjoinable?(sexpr)
    call(builder.from_self(sexpr))
  elsif unjoinable?(right)
    Join.new(builder.from_self(right), builder).call(sexpr)
  else
    super(sexpr)
  end
end