lib/neoid/search_session.rb in neoid-0.1.2 vs lib/neoid/search_session.rb in neoid-0.2.0
- old
+ new
@@ -2,18 +2,18 @@
class SearchSession
def initialize(response, *models)
@response = response || []
@models = models
end
-
+
def hits
@response.map { |x| Neography::Node.new(x) }
end
def ids
- @response.collect { |x| x['data']['ar_id'] }
+ @response.map { |x| x['data']['ar_id'] }
end
-
+
def results
models_by_name = @models.inject({}) { |all, curr| all[curr.name] = curr; all }
ids_by_klass = @response.inject({}) do |all, curr|
klass_name = curr['data']['ar_type']