Class: Factbase::Rules::Query
- Inherits:
-
Object
- Object
- Factbase::Rules::Query
- Defined in:
- lib/factbase/rules.rb
Overview
Query decorator.
This is an internal class, it is not supposed to be instantiated directly.
Instance Method Summary collapse
- #each(params = {}) ⇒ Object
-
#initialize(query, check) ⇒ Query
constructor
A new instance of Query.
Constructor Details
#initialize(query, check) ⇒ Query
Returns a new instance of Query.
107 108 109 110 |
# File 'lib/factbase/rules.rb', line 107 def initialize(query, check) @query = query @check = check end |
Instance Method Details
#each(params = {}) ⇒ Object
112 113 114 115 116 117 |
# File 'lib/factbase/rules.rb', line 112 def each(params = {}) return to_enum(__method__, params) unless block_given? @query.each do |f| yield Fact.new(f, @check) end end |