Module: Konekt

Defined in:
lib/konekt/event.rb,
lib/konekt/railtie.rb,
lib/konekt/version.rb,
lib/konekt/listeners.rb,
lib/konekt/middleware.rb,
lib/konekt/configuration.rb

Defined Under Namespace

Classes: Configuration, Event, Middleware, Railtie

Constant Summary collapse

VERSION =
'0.1.0'
LISTENERS =
Hash.new

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Returns the value of attribute configuration.



4
5
6
# File 'lib/konekt/configuration.rb', line 4

def configuration
  @configuration
end

Class Method Details

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

Yields:



11
12
13
# File 'lib/konekt/configuration.rb', line 11

def self.configure
  yield(configuration)
end

.propagate(event) ⇒ Object



9
10
11
12
13
# File 'lib/konekt/listeners.rb', line 9

def self.propagate(event)
  event.tags.each do |tag|
    Array(LISTENERS[tag]).each { |block| block.call event }
  end
end

.subscribe(event_tag, &block) ⇒ Object



4
5
6
7
# File 'lib/konekt/listeners.rb', line 4

def self.subscribe(event_tag, &block)
  LISTENERS[event_tag] ||= []
  LISTENERS[event_tag] << block
end