Class: OrientDB::AR::Update
- Inherits:
-
Object
- Object
- OrientDB::AR::Update
- Defined in:
- lib/orientdb-ar/sql/update.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#model ⇒ Object
Returns the value of attribute model.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(model, command = OrientDB::SQL::Update.new) ⇒ Update
constructor
A new instance of Update.
- #inspect ⇒ Object (also: #to_s)
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
3 4 5 |
# File 'lib/orientdb-ar/sql/update.rb', line 3 def command @command end |
#model ⇒ Object
Returns the value of attribute model.
3 4 5 |
# File 'lib/orientdb-ar/sql/update.rb', line 3 def model @model end |
Class Method Details
.from_query(query, *args) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/orientdb-ar/sql/update.rb', line 21 def self.from_query(query, *args) obj = new query.model obj.command.instance_variable_set "@conditions", query.query.instance_variable_get("@conditions") obj.command.fields *args obj end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
28 29 30 |
# File 'lib/orientdb-ar/sql/update.rb', line 28 def inspect %{#<OrientDB::AR::Update:#{model.name} command="#{command.to_s}">} end |
#run ⇒ Object
17 18 19 |
# File 'lib/orientdb-ar/sql/update.rb', line 17 def run model.connection.run_command command.to_s end |