Skip to content
Snippets Groups Projects
Commit 42d2ecac authored by Mauricio Giacomini Girardello's avatar Mauricio Giacomini Girardello
Browse files

change GenericsMethods for FinderMethods

parent 270b65ec
No related branches found
No related tags found
No related merge requests found
class OrientDb::Base
include OrientDb::Methods::GenericMethods
include OrientDb::Methods::FinderMethods
def initialize(orientdb_connection)
@connection = orientdb_connection
......@@ -14,7 +14,6 @@ class OrientDb::Base
build_object result
end
def all
objects_hash = connection.query "SELECT FROM #{odb_class}", :limit => -1
objects = build_objects(objects_hash) || []
......@@ -47,11 +46,10 @@ class OrientDb::Base
end
def build_hash(object)
hash = {}
hash["@class"] = odb_class
hash = {'@class' => odb_class}
object.instance_variables.each do |var|
var_name = sanitize_orientdb_vars(var)
hash[var_name] = object.instance_variable_get(var)
hash[var_name] = sanitize_orientdb_values(object.instance_variable_get(var))
end
hash
end
......@@ -60,6 +58,10 @@ class OrientDb::Base
var.to_s.gsub(/\A@/, "")
end
def sanitize_orientdb_values(val)
val
end
def build_object(args={})
raise NoMethodError, "You must implement this method"
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment