Class: Bmg::Sql::Processor::Join
- Inherits:
-
Bmg::Sql::Processor
- Object
- Sexpr::Rewriter
- Bmg::Sql::Processor
- Bmg::Sql::Processor::Join
- Includes:
- JoinSupport
- Defined in:
- lib/bmg/sql/processor/join.rb
Constant Summary
Constants inherited from Bmg::Sql::Processor
Instance Attribute Summary collapse
-
#on ⇒ Object
readonly
Returns the value of attribute on.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Attributes inherited from Bmg::Sql::Processor
Instance Method Summary collapse
- #call(sexpr) ⇒ Object
-
#initialize(right, on, builder) ⇒ Join
constructor
A new instance of Join.
Methods included from JoinSupport
Methods inherited from Bmg::Sql::Processor
#on_select_exp, #on_set_operator, #on_with_exp
Constructor Details
#initialize(right, on, builder) ⇒ Join
Returns a new instance of Join.
7 8 9 10 11 |
# File 'lib/bmg/sql/processor/join.rb', line 7 def initialize(right, on, builder) super(builder) @right = right @on = on end |
Instance Attribute Details
#on ⇒ Object (readonly)
Returns the value of attribute on.
12 13 14 |
# File 'lib/bmg/sql/processor/join.rb', line 12 def on @on end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
12 13 14 |
# File 'lib/bmg/sql/processor/join.rb', line 12 def right @right end |
Instance Method Details
#call(sexpr) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/bmg/sql/processor/join.rb', line 14 def call(sexpr) if unjoinable?(sexpr) call(builder.from_self(sexpr)) elsif unjoinable?(right) Join.new(builder.from_self(right), on, builder).call(sexpr) else super(sexpr) end end |