Module: Replay::Events::ClassMethods

Defined in:
lib/replay/events.rb

Overview

self.constants.each{|c| base.const_set(c, const_get©)}

Instance Method Summary collapse

Instance Method Details

#events(mod = nil, &block) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/replay/events.rb', line 12

def events(mod = nil, &block)
  unless mod
    mod = Module.new do
      extend Replay::EventDeclarations
      module_eval &block
    end
    self.const_set(:Events, mod)
  end
  include mod
end