Module: ExperellaProxy::Globals

Included in:
Backend, Connection, Proxy, Request, Response, Server
Defined in:
lib/experella-proxy/globals.rb

Overview

Provides getters for global variables

All methods are private. The module needs to be included in every Class which needs it.

Instance Method Summary collapse

Instance Method Details

#configConfiguration

Get the global config

Returns:



16
17
18
# File 'lib/experella-proxy/globals.rb', line 16

def config
  ExperellaProxy.config
end

#connection_managerConnectionManager

Get the global connection manager

Returns:



33
34
35
# File 'lib/experella-proxy/globals.rb', line 33

def connection_manager
  ExperellaProxy.connection_manager
end

#event(name, details = {}) ⇒ Object

Dispatch events to event handler

see ExperellaProxy::Configuration#on_event

Parameters:

  • name (Symbol)

    is the name of the event

  • details (Hash) (defaults to: {})

    contains details of the event



26
27
28
# File 'lib/experella-proxy/globals.rb', line 26

def event(name, details={})
  config.on_event.call(name, details)
end

#loggerObject



37
38
39
# File 'lib/experella-proxy/globals.rb', line 37

def logger
  config.logger
end