Class: Seaquel::Statement::Join
- Inherits:
-
Object
- Object
- Seaquel::Statement::Join
- Defined in:
- lib/seaquel/statement/join.rb
Overview
A join clause inside an SQL statement.
Instance Attribute Summary collapse
-
#ons ⇒ Object
readonly
Returns the value of attribute ons.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Instance Method Summary collapse
-
#convert(conversion_helper) ⇒ String
Turns a join statement into SQL by invoking conversion_helper on the right parts.
-
#initialize(tables) ⇒ Join
constructor
A new instance of Join.
- #on(exps) ⇒ Object
Constructor Details
Instance Attribute Details
#ons ⇒ Object (readonly)
Returns the value of attribute ons.
8 9 10 |
# File 'lib/seaquel/statement/join.rb', line 8 def ons @ons end |
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
7 8 9 |
# File 'lib/seaquel/statement/join.rb', line 7 def tables @tables end |
Instance Method Details
#convert(conversion_helper) ⇒ String
Turns a join statement into SQL by invoking conversion_helper on the right parts.
27 28 29 30 31 32 33 |
# File 'lib/seaquel/statement/join.rb', line 27 def convert conversion_helper parts = [] parts << 'INNER JOIN' parts << conversion_helper.convert(tables) parts << 'ON' parts << conversion_helper.convert(ons) end |
#on(exps) ⇒ Object
16 17 18 |
# File 'lib/seaquel/statement/join.rb', line 16 def on exps ons.concat(*exps) end |