class Ocular::Event::EventFactory

Attributes

files[RW]
handlers[RW]

Public Class Methods

new() click to toggle source
# File lib/ocular/event/eventfactory.rb, line 60
def initialize
    @files = {}
    @handlers = ::Ocular::Inputs::Handlers.new
end

Public Instance Methods

get(name) click to toggle source
# File lib/ocular/event/eventfactory.rb, line 85
def get(name)
    return @files[name]
end
load_from_block(name, &block) click to toggle source
# File lib/ocular/event/eventfactory.rb, line 78
def load_from_block(name, &block)
    proxy = DefinitionProxy.new(name, "./", @handlers)
    proxy.instance_eval(&block)
    @files[name] = proxy
    return proxy
end
load_from_file(file, name = nil) click to toggle source
# File lib/ocular/event/eventfactory.rb, line 65
def load_from_file(file, name = nil)
    if !name
        name = file
    end

    pn = Pathname.new(file)

    proxy = DefinitionProxy.new(name, pn.dirname, @handlers)
    proxy.from_file(file)
    @files[name] = proxy
    return proxy
end
start_input_handlers() click to toggle source
# File lib/ocular/event/eventfactory.rb, line 89
def start_input_handlers()
    @handlers.start()
end
stop_input_handlers() click to toggle source
# File lib/ocular/event/eventfactory.rb, line 93
def stop_input_handlers()
    @handlers.stop()
end