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.



71
72
73
74
# File 'lib/rflow/connection.rb', line 71

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

Instance Attribute Details

#messagesObject

Returns the value of attribute messages.



69
70
71
# File 'lib/rflow/connection.rb', line 69

def messages
  @messages
end

Instance Method Details

#send_message(message) ⇒ Object



76
77
78
# File 'lib/rflow/connection.rb', line 76

def send_message(message)
  @messages << message
end