Class: RSwim::Pipe
- Inherits:
-
Object
- Object
- RSwim::Pipe
- Defined in:
- lib/rswim/pipe.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Simple
Class Method Summary collapse
Instance Method Summary collapse
-
#inbound ⇒ Object
returns list of inputs.
-
#initialize(q_in, q_out) ⇒ Pipe
constructor
A new instance of Pipe.
- #send(message) ⇒ Object
Constructor Details
#initialize(q_in, q_out) ⇒ Pipe
Returns a new instance of Pipe.
9 10 11 12 |
# File 'lib/rswim/pipe.rb', line 9 def initialize(q_in, q_out) @q_in = q_in @q_out = q_out end |
Class Method Details
Instance Method Details
#inbound ⇒ Object
returns list of inputs. Empty if none have been received
19 20 21 |
# File 'lib/rswim/pipe.rb', line 19 def inbound Array.new(@q_in.size) { @q_in.pop }.tap(&:compact!) end |
#send(message) ⇒ Object
14 15 16 |
# File 'lib/rswim/pipe.rb', line 14 def send() @q_out << end |