Class: QueryCounter

Inherits:
Object
  • Object
show all
Defined in:
lib/have_query_count/query_counter.rb

Constant Summary collapse

IGNORE =
%w(CACHE SCHEMA TRANSACTION).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeQueryCounter

Returns a new instance of QueryCounter.



6
7
8
# File 'lib/have_query_count/query_counter.rb', line 6

def initialize
  @query_count = 0
end

Instance Attribute Details

#query_countObject (readonly)

Returns the value of attribute query_count.



4
5
6
# File 'lib/have_query_count/query_counter.rb', line 4

def query_count
  @query_count
end

Instance Method Details

#to_procObject



10
# File 'lib/have_query_count/query_counter.rb', line 10

def to_proc = lambda(&method(:callback))