Class: RFlow::Component::OutputPort

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

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) ⇒ Object



193
194
195
196
# File 'lib/rflow/component/port.rb', line 193

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

#connect!Object



188
189
190
191
# File 'lib/rflow/component/port.rb', line 188

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

#send_message(message) ⇒ Object

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



200
201
202
# File 'lib/rflow/component/port.rb', line 200

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