Class: Factbase::Rules::Query

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(query, check) ⇒ Query

Returns a new instance of Query.



115
116
117
118
# File 'lib/factbase/rules.rb', line 115

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

Instance Method Details

#each(params = {}) ⇒ Object



120
121
122
123
124
125
# File 'lib/factbase/rules.rb', line 120

def each(params = {})
  return to_enum(__method__, params) unless block_given?
  @query.each do |f|
    yield Fact.new(f, @check)
  end
end