Class: OData4::Query::Result Private
- Inherits:
-
Object
- Object
- OData4::Query::Result
- Includes:
- Enumerable
- Defined in:
- lib/odata4/query/result.rb,
lib/odata4/query/result/atom.rb,
lib/odata4/query/result/json.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents the results of executing a OData4::Query.
Defined Under Namespace
Instance Attribute Summary collapse
- #query ⇒ Object readonly private
Instance Method Summary collapse
-
#each(&block) ⇒ OData4::Entity
private
Provided for Enumerable functionality.
-
#empty? ⇒ Boolean
private
Checks whether the result set contains any results.
-
#initialize(query, result) ⇒ Result
constructor
private
Initialize a result with the query and the result.
Constructor Details
#initialize(query, result) ⇒ Result
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a result with the query and the result.
13 14 15 16 17 |
# File 'lib/odata4/query/result.rb', line 13 def initialize(query, result) @query = query @result = result check_result_type end |
Instance Attribute Details
#query ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/odata4/query/result.rb', line 8 def query @query end |
Instance Method Details
#each(&block) ⇒ OData4::Entity
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Provided for Enumerable functionality
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/odata4/query/result.rb', line 22 def each(&block) unless empty? process_results(&block) until next_page.nil? # ensure query gets executed with the same options result = query.execute(next_page_url) process_results(&block) end end end |
#empty? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Checks whether the result set contains any results
35 36 37 |
# File 'lib/odata4/query/result.rb', line 35 def empty? @empty_result ||= find_entities.empty? end |