Sha256: 107235a2979f8db04f0b8eb0bb05eec32f89e32bfda0ba1b17848d08c046d565

Contents?: true

Size: 374 Bytes

Versions: 1

Compression:

Stored size: 374 Bytes

Contents

class QueryCounter
  def initialize
    reset
  end

  def read_count
    @info.count { |query|
      /\A\([0-9\.]+s\) SELECT/i === query
    }
  end

  def info(message)
    @info.push(message)
  end

  def error(message)
    @error.push(message)
  end

  def warn(message)
    @warn.push(message)
  end

  def reset
    @info = []
    @error = []
    @warn = []
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sequel_mapper-0.0.1 spec/support/query_counter.rb