class Orchestrate::Application::Result
Packages the result data from GET requests. Orchestrate.io records are returned as Document objects.
Attributes
count[R]
Count of documents in results. Set for list, search, events, and graph.
next[R]
Set for list results.
response[R]
Upon success: the result data is extracted from the response body, but the response body itself is not inluded as part of the result.
Upon failure: the original response body, Orchestrate::API::ResponseBody is left intact and included to provide access to the error details.
results[R]
Array of Document objects.
status[R]
Boolean: return status of the api call.
Public Class Methods
new(results)
click to toggle source
Initialize instance variables, based on type of results.
-
results (key/value)
-
results, count (events, graph)
-
results, count, next (list)
-
results, count, total_count (search)
# File rails/lib/orchestrate_application/result.rb, line 31 def initialize(results) results.each { |k,v| instance_variable_set "@#{k}", v } end
Public Instance Methods
result()
click to toggle source
# File rails/lib/orchestrate_application/result.rb, line 35 def result results.first end
result_keys()
click to toggle source
# File rails/lib/orchestrate_application/result.rb, line 39 def result_keys results.map { |result| result.metadata.key } end
success?()
click to toggle source
# File rails/lib/orchestrate_application/result.rb, line 43 def success? status == true end