Class: SQLConstructor::BasicUnion
- Inherits:
-
GenericQuery
- Object
- SQLObject
- GenericQuery
- SQLConstructor::BasicUnion
- Defined in:
- lib/sqlconstructor.rb
Overview
Internal class which represents a basic UNION statement.
Instance Attribute Summary
Attributes inherited from GenericQuery
#attr_index_hints, #caller, #child_caller, #dialect, #exporter, #string, #tidy, #type
Attributes inherited from SQLObject
#alias, #inline, #name, #separator
Instance Method Summary collapse
-
#_get(*args) ⇒ Object
Override GenericQuery method and send call to @obj.
-
#_remove(*args) ⇒ Object
Override GenericQuery method and send call to @obj.
-
#initialize(_caller, type) ⇒ BasicUnion
constructor
Class contructor.
-
#method_missing(method, *args) ⇒ Object
Send call to @obj.
-
#to_s ⇒ Object
Export to string.
Methods inherited from GenericQuery
Methods inherited from SQLObject
#_name, #_string, #_string=, get
Constructor Details
#initialize(_caller, type) ⇒ BasicUnion
Class contructor. Takes a caller object as the first argument and UNION
type as the second argument. Inits @obj to new SQLConstructor instance
491 492 493 494 495 |
# File 'lib/sqlconstructor.rb', line 491 def initialize ( _caller, type ) @type = type super _caller @obj = SQLConstructor.new( :dialect => @dialect, :tidy => @tidy ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
Send call to @obj
521 522 523 |
# File 'lib/sqlconstructor.rb', line 521 def method_missing ( method, *args ) @obj.send method, *args end |
Instance Method Details
#_get(*args) ⇒ Object
Override GenericQuery method and send call to @obj
507 508 509 |
# File 'lib/sqlconstructor.rb', line 507 def _get ( *args ) @obj._get *args end |
#_remove(*args) ⇒ Object
Override GenericQuery method and send call to @obj
514 515 516 |
# File 'lib/sqlconstructor.rb', line 514 def _remove ( *args ) @obj._remove *args end |
#to_s ⇒ Object
Export to string
500 501 502 |
# File 'lib/sqlconstructor.rb', line 500 def to_s @type + @caller.exporter.separator + @obj.to_s end |