Class: QueuePulse::Notifiers::Test

Inherits:
Base
  • Object
show all
Defined in:
lib/queue_pulse/notifiers/test.rb

Overview

Collects delivered alerts in memory. For use in tests and local dev.

Constant Summary

Constants inherited from Base

Base::MAX_RETRIES, Base::OPEN_TIMEOUT, Base::READ_TIMEOUT

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTest

Returns a new instance of Test.



9
10
11
12
# File 'lib/queue_pulse/notifiers/test.rb', line 9

def initialize
  super()
  @delivered = []
end

Instance Attribute Details

#deliveredObject (readonly)

Returns the value of attribute delivered.



7
8
9
# File 'lib/queue_pulse/notifiers/test.rb', line 7

def delivered
  @delivered
end

Instance Method Details

#clearObject



18
19
20
# File 'lib/queue_pulse/notifiers/test.rb', line 18

def clear
  @delivered.clear
end

#deliver(alerts) ⇒ Object



14
15
16
# File 'lib/queue_pulse/notifiers/test.rb', line 14

def deliver(alerts)
  @delivered.concat(alerts)
end