Class: Sequel::SQL::JoinClause
- Inherits:
- 
      Expression
      
        - Object
- Expression
- Sequel::SQL::JoinClause
 
- Defined in:
- lib/sequel/sql.rb
Overview
Represents an SQL JOIN clause, used for joining tables.
Direct Known Subclasses
Instance Attribute Summary collapse
- 
  
    
      #join_type  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The type of join to do. 
- 
  
    
      #table_expr  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    The expression representing the table/set related to the JOIN. 
Instance Method Summary collapse
- 
  
    
      #column_aliases  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    The column aliases to use for the JOIN , or nil if the JOIN does not use a derived column list. 
- 
  
    
      #initialize(join_type, table_expr)  ⇒ JoinClause 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    Create an object with the given join_type and table expression. 
- 
  
    
      #table  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    The table/set related to the JOIN, without any alias. 
- 
  
    
      #table_alias  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    The table alias to use for the JOIN , or nil if the JOIN does not alias the table. 
Methods inherited from Expression
#==, attr_reader, #clone, #eql?, #hash, inherited, #inspect
Constructor Details
#initialize(join_type, table_expr) ⇒ JoinClause
Create an object with the given join_type and table expression.
| 1548 1549 1550 1551 1552 | # File 'lib/sequel/sql.rb', line 1548 def initialize(join_type, table_expr) @join_type = join_type @table_expr = table_expr freeze end | 
Instance Attribute Details
#join_type ⇒ Object (readonly)
The type of join to do
| 1541 1542 1543 | # File 'lib/sequel/sql.rb', line 1541 def join_type @join_type end | 
#table_expr ⇒ Object (readonly)
The expression representing the table/set related to the JOIN. Is an AliasedExpression if the JOIN uses an alias.
| 1545 1546 1547 | # File 'lib/sequel/sql.rb', line 1545 def table_expr @table_expr end | 
Instance Method Details
#column_aliases ⇒ Object
The column aliases to use for the JOIN , or nil if the JOIN does not use a derived column list.
| 1573 1574 1575 1576 1577 | # File 'lib/sequel/sql.rb', line 1573 def column_aliases if @table_expr.is_a?(AliasedExpression) @table_expr.columns end end | 
#table ⇒ Object
The table/set related to the JOIN, without any alias.
| 1555 1556 1557 1558 1559 1560 1561 | # File 'lib/sequel/sql.rb', line 1555 def table if @table_expr.is_a?(AliasedExpression) @table_expr.expression else @table_expr end end | 
#table_alias ⇒ Object
The table alias to use for the JOIN , or nil if the JOIN does not alias the table.
| 1565 1566 1567 1568 1569 | # File 'lib/sequel/sql.rb', line 1565 def table_alias if @table_expr.is_a?(AliasedExpression) @table_expr.alias end end |