Class: QueryLimit::Listener

Inherits:
Object
  • Object
show all
Defined in:
lib/query_limit/listener.rb

Defined Under Namespace

Classes: Entry, Global

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeListener

Returns a new instance of Listener.



9
10
11
# File 'lib/query_limit/listener.rb', line 9

def initialize
  @stack = []
end

Instance Attribute Details

#stackObject (readonly)

Returns the value of attribute stack.



7
8
9
# File 'lib/query_limit/listener.rb', line 7

def stack
  @stack
end

Instance Method Details

#sequel_query(sql, stacktrace) ⇒ Object



13
14
15
# File 'lib/query_limit/listener.rb', line 13

def sequel_query(sql, stacktrace)
  @stack << Entry.new(sql, stacktrace)
end