Class: PoolLint::SuspicionLog
- Inherits:
-
Object
- Object
- PoolLint::SuspicionLog
- Defined in:
- lib/poollint/suspicion_log.rb
Constant Summary collapse
- SQL_LIMIT =
200
Instance Method Summary collapse
- #add(suspicion) ⇒ Object
- #clear ⇒ Object
- #entries ⇒ Object
-
#initialize(limit:) ⇒ SuspicionLog
constructor
A new instance of SuspicionLog.
Constructor Details
#initialize(limit:) ⇒ SuspicionLog
Returns a new instance of SuspicionLog.
17 18 19 20 |
# File 'lib/poollint/suspicion_log.rb', line 17 def initialize(limit:) @limit = limit @entries = [] end |
Instance Method Details
#add(suspicion) ⇒ Object
22 23 24 25 |
# File 'lib/poollint/suspicion_log.rb', line 22 def add(suspicion) @entries.shift if @entries.length >= @limit @entries << normalized(suspicion) end |
#clear ⇒ Object
27 28 29 |
# File 'lib/poollint/suspicion_log.rb', line 27 def clear @entries.clear end |
#entries ⇒ Object
31 32 33 |
# File 'lib/poollint/suspicion_log.rb', line 31 def entries @entries.dup end |