Class: Opencrx::Model::ResultSet
- Inherits:
-
Array
- Object
- Array
- Opencrx::Model::ResultSet
- Defined in:
- lib/opencrx/model/result_set.rb
Constant Summary collapse
- KEY =
'org.openmdx.kernel.ResultSet'
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ ResultSet
constructor
A new instance of ResultSet.
- #more? ⇒ Boolean
- #result_set ⇒ Object
- #results ⇒ Object
- #total ⇒ Object
Constructor Details
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
6 7 8 |
# File 'lib/opencrx/model/result_set.rb', line 6 def response @response end |
Instance Method Details
#more? ⇒ Boolean
16 17 18 |
# File 'lib/opencrx/model/result_set.rb', line 16 def more? response[KEY]['hasMore'] == 'true' end |
#result_set ⇒ Object
39 40 41 |
# File 'lib/opencrx/model/result_set.rb', line 39 def result_set response[KEY] || [] end |
#results ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/opencrx/model/result_set.rb', line 24 def results result_set.map do |key, value| #puts "SET: #{key}" #ap value case value when Array value.map { |v| Result.parse(key => v) } when Hash Result.parse(key => value) else # ignore end end.flatten.compact end |
#total ⇒ Object
20 21 22 |
# File 'lib/opencrx/model/result_set.rb', line 20 def total response[KEY]['total'] end |