class BlueprintAgreement::Server

Public Class Methods

new(api_service:, config:) click to toggle source
# File lib/blueprint_agreement/server.rb, line 4
def initialize(api_service:, config:)
  @api_service = api_service
  @config = config
end

Public Instance Methods

host() click to toggle source
# File lib/blueprint_agreement/server.rb, line 28
def host
  @api_service.host
end
restart(path) click to toggle source
# File lib/blueprint_agreement/server.rb, line 19
def restart(path)
  stop
  @api_service.start(path)
end
start(path=@config.default_format) click to toggle source
# File lib/blueprint_agreement/server.rb, line 9
def start(path=@config.default_format)
  @api_service.install unless @api_service.installed?

  if @config.active_service
    restart(path) if @config.active_service[:path] != path
  else
    @api_service.start(path)
  end
end
stop() click to toggle source
# File lib/blueprint_agreement/server.rb, line 24
def stop
  @api_service.stop
end