Class: RFlow::Component::OutputPort

Inherits:
HashPort show all
Defined in:
lib/rflow/component/port.rb

Overview

An actual RFlow::Component output port.

Instance Attribute Summary

Attributes inherited from HashPort

#name, #uuid

Attributes inherited from Port

#component, #connected

Instance Method Summary collapse

Methods inherited from HashPort

#[], #all_connections, #collect_messages, #connections_for, #direct_connect, #each, #initialize, #keys, #remove_connection

Methods inherited from Port

#connected?, #initialize

Constructor Details

This class inherits a constructor from RFlow::Component::HashPort

Instance Method Details

#add_connection(key, connection) ⇒ void

This method returns an undefined value.

Add and start up a new RFlow::Connection.

Parameters:

  • key (String)

    the key to subscript with

  • connection (Connection)

    the connection to add



288
289
290
291
# File 'lib/rflow/component/port.rb', line 288

def add_connection(key, connection)
  super
  connection.connect_output! if connected?
end

#connect!void

This method returns an undefined value.

Connect all the output connections, once everything’s been set up.



279
280
281
282
# File 'lib/rflow/component/port.rb', line 279

def connect!
  @connections_for.each {|key, conns| conns.each {|c| c.connect_output! } }
  @connected = true
end

#send_message(message) ⇒ void

This method returns an undefined value.

Send a message to all connections on all keys for this port, but only once per connection.

Parameters:



297
298
299
# File 'lib/rflow/component/port.rb', line 297

def send_message(message)
  all_connections.send_message(message)
end