Class: Spoolprint::ServerReceipt

Inherits:
Server
  • Object
show all
Defined in:
lib/spoolprint/server_receipt.rb

Constant Summary collapse

ASAL_SERVER_PORT =
7776

Instance Method Summary collapse

Constructor Details

#initialize(spool) ⇒ ServerReceipt

Returns a new instance of ServerReceipt.



7
8
9
10
11
12
13
# File 'lib/spoolprint/server_receipt.rb', line 7

def initialize(spool)
  super(ASAL_SERVER_PORT)
  @spool = spool
  @manager = ReceiverManager.new(method(:read_driver))
  @server_zone = Thread.new { server_bergulir }
  @bergulir = false
end

Instance Method Details

#startObject



15
16
17
18
# File 'lib/spoolprint/server_receipt.rb', line 15

def start
  @bergulir = true
  @server_zone.run if @server_zone.stop?
end

#stopObject



20
21
22
# File 'lib/spoolprint/server_receipt.rb', line 20

def stop
  @bergulir = false
end