Class: Factbase::Inv::Query

Inherits:
Object
  • Object
show all
Defined in:
lib/factbase/inv.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, block, fb) ⇒ Query

Returns a new instance of Query.



79
80
81
82
83
# File 'lib/factbase/inv.rb', line 79

def initialize(query, block, fb)
  @query = query
  @block = block
  @fb = fb
end

Instance Method Details

#each(fb = @fb, params = {}) ⇒ Object



89
90
91
92
93
94
# File 'lib/factbase/inv.rb', line 89

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

#to_sObject



85
86
87
# File 'lib/factbase/inv.rb', line 85

def to_s
  @query.to_s
end