Class: OrientDB::SQL::Update
- Inherits:
-
Object
- Object
- OrientDB::SQL::Update
- Includes:
- ClassClusterParametersMixin, ConditionsParametersMixin, FieldsValuesParametersMixin, UtilsMixin
- Defined in:
- lib/orientdb/sql/update.rb
Instance Method Summary collapse
- #action(new_action) ⇒ Object (also: #action!)
-
#initialize ⇒ Update
constructor
A new instance of Update.
- #to_s ⇒ Object
- #to_sql_command ⇒ Object
Methods included from ConditionsParametersMixin
#and, #and_not, #or, #or_not, #where, #where!
Methods included from FieldsValuesParametersMixin
#fields, #fields!, #values, #values!
Methods included from ClassClusterParametersMixin
Methods included from UtilsMixin
#field_name, #quote, #quote_regexp, #quote_string, #select_single_string
Constructor Details
#initialize ⇒ Update
Returns a new instance of Update.
9 10 11 12 13 14 15 16 |
# File 'lib/orientdb/sql/update.rb', line 9 def initialize @oclass = nil @cluster = nil @action = "SET" @fields = [] @values = [] @conditions = [] end |
Instance Method Details
#action(new_action) ⇒ Object Also known as: action!
18 19 20 21 |
# File 'lib/orientdb/sql/update.rb', line 18 def action(new_action) @action = new_action.to_s.upcase self end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/orientdb/sql/update.rb', line 25 def to_s (target_sql(:update) + fields_sql + conditions_sql).strip end |
#to_sql_command ⇒ Object
29 30 31 |
# File 'lib/orientdb/sql/update.rb', line 29 def to_sql_command OrientDB::SQLCommand.new to_s end |