Class: Oso::Polar::Query
- Inherits:
-
Object
- Object
- Oso::Polar::Query
- Includes:
- Enumerable
- Defined in:
- lib/oso/polar/query.rb
Overview
A single Polar query.
Instance Method Summary collapse
-
#each {|| ... } ⇒ Enumerator
Create an enumerator that can be polled to advance the query loop.
-
#initialize(ffi_query, host:, bindings: {}) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(ffi_query, host:, bindings: {}) ⇒ Query
Returns a new instance of Query.
13 14 15 16 17 18 19 |
# File 'lib/oso/polar/query.rb', line 13 def initialize(ffi_query, host:, bindings: {}) @calls = {} @ffi_query = ffi_query ffi_query. = host.method(:enrich_message) @host = host bindings.each { |k, v| ffi_query.bind k, host.to_polar(v) } end |
Instance Method Details
#each {|| ... } ⇒ Enumerator
Create an enumerator that can be polled to advance the query loop. Yields results one by one.
27 28 29 |
# File 'lib/oso/polar/query.rb', line 27 def each(&block) run(&block) end |