Module: Clamour

Extended by:
ActiveSupport::Autoload
Defined in:
lib/clamour.rb,
lib/clamour/version.rb

Defined Under Namespace

Modules: Handler, Message Classes: Bus, Configuration, Railtie, Registry, Subscription

Constant Summary collapse

VERSION =
'0.0.3'

Class Method Summary collapse

Class Method Details

.configurationClamour::Configuration

Clamour-wide configuration.



18
19
20
# File 'lib/clamour.rb', line 18

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

.configure {|Clamour::Configuration| ... } ⇒ Object

Shortcut for Clamour-wide configuration.

Examples:

Clamour.configure do |config|
  config.exchange = 'com.example.exchange'
  config.logger = MonoLogger.new(STDOUT)
end

Yields:

See Also:



31
32
33
# File 'lib/clamour.rb', line 31

def self.configure(&block)
  block.call(configuration) if block_given?
end

.registryObject

Clamour-wide message handlers registry.

Examples:

To add handlers

Clamour.registry.change do
  on Social::User::New => Social::User::Greeting::Send
end

See Also:



42
43
44
45
46
# File 'lib/clamour.rb', line 42

def self.registry
  @registry ||= Clamour::Registry.new do
    on Clamour::Message::Sent => Clamour::Message::Receive
  end
end