Class: Stenotype::Adapters::TestAdapter
- Defined in:
- lib/stenotype/adapters/test_adapter.rb
Instance Attribute Summary collapse
-
#buffer ⇒ Object
readonly
Returns the value of attribute buffer.
Attributes inherited from Base
Instance Method Summary collapse
-
#flush! ⇒ Object
Clears the buffer.
-
#initialize(*_) ⇒ TestAdapter
constructor
A new instance of TestAdapter.
- #publish(event_data, **additional_attrs) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(*_) ⇒ TestAdapter
Returns a new instance of TestAdapter.
8 9 10 11 |
# File 'lib/stenotype/adapters/test_adapter.rb', line 8 def initialize(*_) @buffer = Array.new super() end |
Instance Attribute Details
#buffer ⇒ Object (readonly)
Returns the value of attribute buffer.
6 7 8 |
# File 'lib/stenotype/adapters/test_adapter.rb', line 6 def buffer @buffer end |
Instance Method Details
#flush! ⇒ Object
Clears the buffer
24 25 26 |
# File 'lib/stenotype/adapters/test_adapter.rb', line 24 def flush! buffer.clear end |
#publish(event_data, **additional_attrs) ⇒ Object
17 18 19 |
# File 'lib/stenotype/adapters/test_adapter.rb', line 17 def publish(event_data, **additional_attrs) buffer << parse(event_data) end |