Class: Backport::Server::Stdio
- Includes:
- Connectable
- Defined in:
- lib/backport/server/stdio.rb
Overview
A Backport STDIO server.
Instance Method Summary collapse
-
#initialize(input: STDIN, output: STDOUT, adapter: Adapter) ⇒ Stdio
constructor
A new instance of Stdio.
- #update(client) ⇒ void
Methods included from Connectable
#clients, #starting, #stopping
Methods inherited from Base
#start, #started?, #starting, #stop, #stopped?, #stopping, #tick
Constructor Details
#initialize(input: STDIN, output: STDOUT, adapter: Adapter) ⇒ Stdio
Returns a new instance of Stdio.
11 12 13 14 15 16 17 18 |
# File 'lib/backport/server/stdio.rb', line 11 def initialize input: STDIN, output: STDOUT, adapter: Adapter @in = input @out = output @out.binmode @adapter = adapter clients.push Client.new(input, output, adapter) clients.last.add_observer self end |
Instance Method Details
#update(client) ⇒ void
This method returns an undefined value.
22 23 24 |
# File 'lib/backport/server/stdio.rb', line 22 def update client client.tick end |