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.



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