class Fake::Service
Public Class Methods
new(port:8080, bind:"localhost")
click to toggle source
# File lib/fake/service.rb, line 3 def initialize(port:8080, bind:"localhost") @app = RackApp.new @webrick_config = {Port:port, BindAddress:bind} @server = Server.new end
Public Instance Methods
add_request_handler(request_handler)
click to toggle source
# File lib/fake/service.rb, line 9 def add_request_handler(request_handler) @app.add_request_handler(request_handler) end
clear()
click to toggle source
# File lib/fake/service.rb, line 21 def clear @app.clear_request_handlers end
start()
click to toggle source
# File lib/fake/service.rb, line 13 def start @server.start(@app, @webrick_config) end
stop()
click to toggle source
# File lib/fake/service.rb, line 17 def stop @server.stop end