Internal class which represents a basic JOIN statement.
Class contructor. Takes a caller object as the first argument, JOIN type as the second argument, and a list of sources for the JOIN clause
# File lib/sqlconstructor.rb, line 446 def initialize ( _caller, type, *sources ) type = type.to_s type.upcase!.gsub! /_/, ' ' super _caller @type = type @join_sources = SQLAliasedList.new *sources end
Adds more sources to @join_sources list
# File lib/sqlconstructor.rb, line 457 def join_more ( *sources ) @join_sources.push *sources end
Export to string with sources aliases
# File lib/sqlconstructor.rb, line 464 def to_s return @string if @string result = @type + " " arr = [ ] @join_sources.each do |src| _alias = src.alias ? " " + src.alias.to_s : "" str = src.to_s + _alias arr << str end result += arr.join ',' result += @exporter.separator result += "ON " + @join_on.val.to_s if @join_on @string = result end
Generated with the Darkfish Rdoc Generator 2.