Class: RFlow::MessageCollectingConnection

Inherits:
Connection
  • Object
show all
Defined in:
lib/rflow/connection.rb

Overview

Primarily for testing purposes. Captures whatever messages are sent on it.

Instance Attribute Summary collapse

Attributes inherited from Connection

#config, #name, #options, #recv_callback, #uuid

Instance Method Summary collapse

Methods inherited from Connection

build, #connect_input!, #connect_output!, #input_port_key, #output_port_key

Constructor Details

#initializeMessageCollectingConnection

Returns a new instance of MessageCollectingConnection.



100
101
102
103
# File 'lib/rflow/connection.rb', line 100

def initialize
  super(RFlow::Configuration::NullConnectionConfiguration.new)
  @messages = []
end

Instance Attribute Details

#messagesArray<RFlow::Message>

The messages that were collected.

Returns:



98
99
100
# File 'lib/rflow/connection.rb', line 98

def messages
  @messages
end

Instance Method Details

#send_message(message) ⇒ void

This method returns an undefined value.

Override of #send_message which adds the message to #messages.



107
108
109
# File 'lib/rflow/connection.rb', line 107

def send_message(message)
  @messages << message
end