Class: SQLConstructor::BasicUpdate
- Inherits:
-
GenericQuery
- Object
- SQLObject
- GenericQuery
- SQLConstructor::BasicUpdate
- Defined in:
- lib/sqlconstructor.rb
Overview
Internal class which represents a basic INSERT statement.
Direct Known Subclasses
Constant Summary collapse
- METHODS =
{ :tables => QAttr.new( :name => 'upd_tables', :text => '', :val => SQLObject ), :set => QAttr.new( :name => 'upd_set', :text => 'SET', :val => SQLCondList ), :where => QAttr.new( :name => 'attr_where', :text => 'WHERE', :val => SQLConditional), :first => QAttr.new( :name => 'attr_first', :text => 'FIRST', :val => SQLObject ), :skip => QAttr.new( :name => 'attr_skip', :text => 'SKIP', :val => SQLObject ), }
Instance Attribute Summary collapse
-
#attr_first ⇒ Object
Returns the value of attribute attr_first.
-
#attr_order_by ⇒ Object
Returns the value of attribute attr_order_by.
-
#attr_skip ⇒ Object
Returns the value of attribute attr_skip.
-
#attr_where ⇒ Object
Returns the value of attribute attr_where.
-
#upd_set ⇒ Object
Returns the value of attribute upd_set.
-
#upd_tables ⇒ Object
Returns the value of attribute upd_tables.
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
-
#initialize(_caller, *list) ⇒ BasicUpdate
constructor
Class constructor.
-
#update_more(*list) ⇒ Object
Add tables to UPDATE tables list ( @upd_tables ).
Methods inherited from GenericQuery
#_get, #_remove, #method_missing, #to_s, #to_str
Methods inherited from SQLObject
#_name, #_string, #_string=, get, #to_s
Constructor Details
#initialize(_caller, *list) ⇒ BasicUpdate
Class constructor.
_caller - the caller object
682 683 684 685 686 |
# File 'lib/sqlconstructor.rb', line 682 def initialize ( _caller, *list ) super _caller @upd_tables = QAttr.new( :name => 'upd_tables', :text => '', :val => SQLAliasedList.new( *list ) ) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SQLConstructor::GenericQuery
Instance Attribute Details
#attr_first ⇒ Object
Returns the value of attribute attr_first.
668 669 670 |
# File 'lib/sqlconstructor.rb', line 668 def attr_first @attr_first end |
#attr_order_by ⇒ Object
Returns the value of attribute attr_order_by.
668 669 670 |
# File 'lib/sqlconstructor.rb', line 668 def attr_order_by @attr_order_by end |
#attr_skip ⇒ Object
Returns the value of attribute attr_skip.
668 669 670 |
# File 'lib/sqlconstructor.rb', line 668 def attr_skip @attr_skip end |
#attr_where ⇒ Object
Returns the value of attribute attr_where.
668 669 670 |
# File 'lib/sqlconstructor.rb', line 668 def attr_where @attr_where end |
#upd_set ⇒ Object
Returns the value of attribute upd_set.
668 669 670 |
# File 'lib/sqlconstructor.rb', line 668 def upd_set @upd_set end |
#upd_tables ⇒ Object
Returns the value of attribute upd_tables.
668 669 670 |
# File 'lib/sqlconstructor.rb', line 668 def upd_tables @upd_tables end |
Instance Method Details
#update_more(*list) ⇒ Object
Add tables to UPDATE tables list ( @upd_tables )
691 692 693 |
# File 'lib/sqlconstructor.rb', line 691 def update_more ( *list ) @upd_tables.val.push *list end |