Class: Droonga::Test::StubHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/test/stub_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStubHandler

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

#contextObject (readonly)

Returns the value of attribute context.



21
22
23
# File 'lib/droonga/test/stub_handler.rb', line 21

def context
  @context
end

#envelopeObject (readonly)

Returns the value of attribute envelope.



21
22
23
# File 'lib/droonga/test/stub_handler.rb', line 21

def envelope
  @envelope
end

#messagesObject (readonly)

Returns the value of attribute messages.



21
22
23
# File 'lib/droonga/test/stub_handler.rb', line 21

def messages
  @messages
end

Instance Method Details

#emit(message) ⇒ Object



28
29
30
# File 'lib/droonga/test/stub_handler.rb', line 28

def emit(message)
  @messages << message
end

#forward(message, destination) ⇒ Object



32
33
34
# File 'lib/droonga/test/stub_handler.rb', line 32

def forward(message, destination)
  @messages << [message, destination]
end