Class: RFlow::Component::HashSubPort
- Inherits:
-
Object
- Object
- RFlow::Component::HashSubPort
- Defined in:
- lib/rflow/component/port.rb
Overview
Stateless class to help with a nicer API
Instance Method Summary collapse
- #connections ⇒ Object
- #direct_connect(other_port) ⇒ Object
- #each ⇒ Object
-
#initialize(hash_port, key) ⇒ HashSubPort
constructor
A new instance of HashSubPort.
- #send_message(message) ⇒ Object
Constructor Details
#initialize(hash_port, key) ⇒ HashSubPort
Returns a new instance of HashSubPort.
49 50 51 52 |
# File 'lib/rflow/component/port.rb', line 49 def initialize(hash_port, key) @hash_port = hash_port @key = key end |
Instance Method Details
#connections ⇒ Object
58 59 60 |
# File 'lib/rflow/component/port.rb', line 58 def connections @hash_port.connections_for(@key) end |
#direct_connect(other_port) ⇒ Object
62 63 64 |
# File 'lib/rflow/component/port.rb', line 62 def direct_connect(other_port) @hash_port.direct_connect(@key, other_port) end |
#each ⇒ Object
66 67 68 |
# File 'lib/rflow/component/port.rb', line 66 def each connections.each {|connection| yield connection } end |
#send_message(message) ⇒ Object
54 55 56 |
# File 'lib/rflow/component/port.rb', line 54 def () connections.each {|connection| connection.() } end |