Class: OData::Query::Result Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/odata/query/result.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 OData::Query.

Instance Method Summary collapse

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.



11
12
13
14
# File 'lib/odata/query/result.rb', line 11

def initialize(query, result)
  @query      = query
  @result     = result
end

Instance Method Details

#each(&block) ⇒ OData::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



19
20
21
22
23
24
# File 'lib/odata/query/result.rb', line 19

def each(&block)
  service.find_entities(result).each do |entity_xml|
    entity = OData::Entity.from_xml(entity_xml, entity_options)
    block_given? ? block.call(entity) : yield(entity)
  end
end