Module: BunnyExchanges

Defined in:
lib/bunny_exchanges.rb,
lib/bunny_exchanges/manager.rb,
lib/bunny_exchanges/version.rb,
lib/bunny_exchanges/configuration.rb

Defined Under Namespace

Classes: Configuration, Manager

Constant Summary collapse

UndefinedExchange =

The required exchange is not defined.

Class.new(StandardError)
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.configurationConfiguration

BunnyExchanges configuration

Returns:



10
11
12
# File 'lib/bunny_exchanges.rb', line 10

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

A helper to configure BunnyExchanges

Yields:



17
18
19
# File 'lib/bunny_exchanges.rb', line 17

def self.configure
  yield configuration
end

.get(action) ⇒ Bunny::Exchange

Delegates ‘#get` to the current manager. Returns the required exchange.

Parameters:

  • the (Symbol, String)

    action name

Returns:

  • (Bunny::Exchange)

    the required exchange.

Raises:

See Also:

  • Tenant.using


28
29
30
# File 'lib/bunny_exchanges.rb', line 28

def self.get action
  manager.get(action)
end

.managerBunnyExchanges::Manager

The current instance of Manager.

Returns:

See Also:

  • Tenant.using


36
37
38
# File 'lib/bunny_exchanges.rb', line 36

def self.manager
  @manager ||= Manager.new(configuration)
end