Class: Prequel::Sql::InnerJoinedTableRef
- Inherits:
-
Object
- Object
- Prequel::Sql::InnerJoinedTableRef
- Defined in:
- lib/prequel/sql/inner_joined_table_ref.rb
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #build_tuple(field_values) ⇒ Object
-
#initialize(left, right, predicate) ⇒ InnerJoinedTableRef
constructor
A new instance of InnerJoinedTableRef.
- #to_sql ⇒ Object
Constructor Details
#initialize(left, right, predicate) ⇒ InnerJoinedTableRef
Returns a new instance of InnerJoinedTableRef.
5 6 7 |
# File 'lib/prequel/sql/inner_joined_table_ref.rb', line 5 def initialize(left, right, predicate) @left, @right, @predicate = left, right, predicate end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
4 5 6 |
# File 'lib/prequel/sql/inner_joined_table_ref.rb', line 4 def left @left end |
#predicate ⇒ Object (readonly)
Returns the value of attribute predicate.
4 5 6 |
# File 'lib/prequel/sql/inner_joined_table_ref.rb', line 4 def predicate @predicate end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
4 5 6 |
# File 'lib/prequel/sql/inner_joined_table_ref.rb', line 4 def right @right end |
Instance Method Details
#build_tuple(field_values) ⇒ Object
18 19 20 |
# File 'lib/prequel/sql/inner_joined_table_ref.rb', line 18 def build_tuple(field_values) CompositeTuple.new(left.build_tuple(field_values), right.build_tuple(field_values)) end |
#to_sql ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/prequel/sql/inner_joined_table_ref.rb', line 9 def to_sql [left.to_sql, 'inner join', right.to_sql, 'on', predicate.to_sql ].join(' ') end |