Class: SWIPL::Query
- Inherits:
-
Object
- Object
- SWIPL::Query
- Defined in:
- lib/swipl/query.rb
Instance Method Summary collapse
- #close ⇒ Object
- #each_solution ⇒ Object
-
#initialize(qid, terms) ⇒ Query
constructor
A new instance of Query.
- #next_solution? ⇒ Boolean
Constructor Details
#initialize(qid, terms) ⇒ Query
Returns a new instance of Query.
4 5 6 7 |
# File 'lib/swipl/query.rb', line 4 def initialize( qid, terms ) @query_id = qid @terms = terms end |
Instance Method Details
#close ⇒ Object
19 20 21 |
# File 'lib/swipl/query.rb', line 19 def close CFFI.PL_close_query( @query_id ) end |
#each_solution ⇒ Object
13 14 15 16 17 |
# File 'lib/swipl/query.rb', line 13 def each_solution while next_solution? yield(@terms) end end |