Class: OrientDB::AR::Delete
- Inherits:
-
Object
- Object
- OrientDB::AR::Delete
- Defined in:
- lib/orientdb-ar/sql/delete.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::Delete.new) ⇒ Delete
constructor
A new instance of Delete.
- #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/delete.rb', line 3 def command @command end |
#model ⇒ Object
Returns the value of attribute model.
3 4 5 |
# File 'lib/orientdb-ar/sql/delete.rb', line 3 def model @model end |
Class Method Details
.from_query(query) ⇒ Object
17 18 19 20 21 |
# File 'lib/orientdb-ar/sql/delete.rb', line 17 def self.from_query(query) obj = new query.model obj.command.instance_variable_set "@conditions", query.query.instance_variable_get("@conditions") obj end |
Instance Method Details
#inspect ⇒ Object Also known as: to_s
27 28 29 |
# File 'lib/orientdb-ar/sql/delete.rb', line 27 def inspect %{#<OrientDB::AR::Delete:#{model.name} command="#{command.to_s}">} end |
#run ⇒ Object
23 24 25 |
# File 'lib/orientdb-ar/sql/delete.rb', line 23 def run model.connection.run_command command.to_s end |