Class: Bmg::Sql::Processor::SemiJoin

Inherits:
Bmg::Sql::Processor show all
Includes:
JoinSupport
Defined in:
lib/bmg/sql/processor/semi_join.rb

Constant Summary

Constants inherited from Bmg::Sql::Processor

UnexpectedError

Instance Attribute Summary collapse

Attributes inherited from Bmg::Sql::Processor

#builder

Instance Method Summary collapse

Methods included from JoinSupport

#on_main_exp

Methods inherited from Bmg::Sql::Processor

#on_select_exp, #on_set_operator, #on_with_exp

Constructor Details

#initialize(right, on, negate = false, builder) ⇒ SemiJoin

Returns a new instance of SemiJoin.



7
8
9
10
11
12
# File 'lib/bmg/sql/processor/semi_join.rb', line 7

def initialize(right, on, negate = false, builder)
  super(builder)
  @right  = right
  @on = on
  @negate = negate
end

Instance Attribute Details

#negateObject (readonly)

Returns the value of attribute negate.



13
14
15
# File 'lib/bmg/sql/processor/semi_join.rb', line 13

def negate
  @negate
end

#onObject (readonly)

Returns the value of attribute on.



13
14
15
# File 'lib/bmg/sql/processor/semi_join.rb', line 13

def on
  @on
end

#rightObject (readonly)

Returns the value of attribute right.



13
14
15
# File 'lib/bmg/sql/processor/semi_join.rb', line 13

def right
  @right
end

Instance Method Details

#call(sexpr) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/bmg/sql/processor/semi_join.rb', line 15

def call(sexpr)
  if sexpr.set_operator?
    call(builder.from_self(sexpr))
  elsif right.set_operator?
    SemiJoin.new(builder.from_self(right), negate, builder).call(sexpr)
  else
    super(sexpr)
  end
end