Class: Esbuild::ServeResult

Inherits:
Object
  • Object
show all
Defined in:
lib/esbuild/serve_result.rb

Instance Method Summary collapse

Constructor Details

#initialize(response, wait, stop) ⇒ ServeResult

Returns a new instance of ServeResult.



3
4
5
6
7
8
9
# File 'lib/esbuild/serve_result.rb', line 3

def initialize(response, wait, stop)
  @port = response["port"]
  @host = response["host"]
  @wait = wait
  @stop = stop
  @is_stopped = false
end

Instance Method Details

#stopObject



16
17
18
19
20
# File 'lib/esbuild/serve_result.rb', line 16

def stop
  return if @is_stopped
  @is_stopped = true
  @stop.call
end

#waitObject



11
12
13
14
# File 'lib/esbuild/serve_result.rb', line 11

def wait
  @wait.wait!
  @wait.value
end