Class: JoinOptions
- Defined in:
- lib/activeleopard/query_clauses/join_clause.rb
Instance Attribute Summary collapse
-
#clauses ⇒ Object
readonly
Returns the value of attribute clauses.
Instance Method Summary collapse
- #append(assoc_options, source_table) ⇒ Object
- #as_sql ⇒ Object
-
#initialize(assoc_options = nil, source_table = nil) ⇒ JoinOptions
constructor
A new instance of JoinOptions.
Constructor Details
#initialize(assoc_options = nil, source_table = nil) ⇒ JoinOptions
Returns a new instance of JoinOptions.
32 33 34 35 36 37 |
# File 'lib/activeleopard/query_clauses/join_clause.rb', line 32 def initialize( = nil, source_table = nil) @clauses = [] if && source_table @clauses << JoinClause.new(, source_table) end end |
Instance Attribute Details
#clauses ⇒ Object (readonly)
Returns the value of attribute clauses.
30 31 32 |
# File 'lib/activeleopard/query_clauses/join_clause.rb', line 30 def clauses @clauses end |
Instance Method Details
#append(assoc_options, source_table) ⇒ Object
43 44 45 |
# File 'lib/activeleopard/query_clauses/join_clause.rb', line 43 def append(, source_table) clauses << JoinClause.new(, source_table) end |
#as_sql ⇒ Object
39 40 41 |
# File 'lib/activeleopard/query_clauses/join_clause.rb', line 39 def as_sql clauses.map(&:as_sql).join(" \n ") end |