Module: RSpecQueryCounter::Counter

Defined in:
lib/rspec_query_counter/counter.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.query_type_countObject

Returns the value of attribute query_type_count.



5
6
7
# File 'lib/rspec_query_counter/counter.rb', line 5

def query_type_count
  @query_type_count
end

.total_query_countObject

Returns the value of attribute total_query_count.



5
6
7
# File 'lib/rspec_query_counter/counter.rb', line 5

def total_query_count
  @total_query_count
end

Class Method Details

.increment_query_type_count(name) ⇒ Object



16
17
18
19
# File 'lib/rspec_query_counter/counter.rb', line 16

def increment_query_type_count(name)
  @query_type_count[name] ||= 0
  @query_type_count[name] += 1
end

.increment_total_countObject



12
13
14
# File 'lib/rspec_query_counter/counter.rb', line 12

def increment_total_count
  @total_query_count += 1
end

.reset_counter!Object



7
8
9
10
# File 'lib/rspec_query_counter/counter.rb', line 7

def reset_counter!
  @total_query_count = 0
  @query_type_count = {}
end