Class: Bmg::Sql::Processor::Join

Inherits:
Bmg::Sql::Processor show all
Includes:
JoinSupport
Defined in:
lib/bmg/sql/processor/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, options, builder) ⇒ Join

Returns a new instance of Join.



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

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

Instance Attribute Details

#onObject (readonly)

Returns the value of attribute on.



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

def on
  @on
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#rightObject (readonly)

Returns the value of attribute right.



13
14
15
# File 'lib/bmg/sql/processor/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/join.rb', line 15

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