Module: Calltally::Plugin

Defined in:
lib/calltally/plugin.rb

Class Method Summary collapse

Class Method Details

.handle(path, src, cfg) ⇒ Object



12
13
14
15
16
# File 'lib/calltally/plugin.rb', line 12

def handle(path, src, cfg)
  if (handler = @handlers[File.extname(path)])
    handler.call(path, src, cfg)
  end
end

.register(ext, &block) ⇒ Object



8
9
10
# File 'lib/calltally/plugin.rb', line 8

def register(ext, &block)
  @handlers[ext] = block
end

.registered_extsObject



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

def registered_exts
  @handlers.keys
end