Class: Droonga::Test::StubHandler
- Inherits:
-
Object
- Object
- Droonga::Test::StubHandler
- Defined in:
- lib/droonga/test/stub_handler.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#envelope ⇒ Object
readonly
Returns the value of attribute envelope.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #emit(message) ⇒ Object
- #forward(message, destination) ⇒ Object
-
#initialize ⇒ StubHandler
constructor
A new instance of StubHandler.
Constructor Details
#initialize ⇒ StubHandler
Returns a new instance of StubHandler.
22 23 24 25 26 |
# File 'lib/droonga/test/stub_handler.rb', line 22 def initialize @context = Groonga::Context.default @envelope = {} @messages = [] end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
21 22 23 |
# File 'lib/droonga/test/stub_handler.rb', line 21 def context @context end |
#envelope ⇒ Object (readonly)
Returns the value of attribute envelope.
21 22 23 |
# File 'lib/droonga/test/stub_handler.rb', line 21 def envelope @envelope end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
21 22 23 |
# File 'lib/droonga/test/stub_handler.rb', line 21 def @messages end |
Instance Method Details
#emit(message) ⇒ Object
28 29 30 |
# File 'lib/droonga/test/stub_handler.rb', line 28 def emit() @messages << end |
#forward(message, destination) ⇒ Object
32 33 34 |
# File 'lib/droonga/test/stub_handler.rb', line 32 def forward(, destination) @messages << [, destination] end |