Sha256: 53dca27e267789b3e58fcaab0ea2abb285e209efc5cda217b05602aa5695c4b5
Contents?: true
Size: 871 Bytes
Versions: 54
Compression:
Stored size: 871 Bytes
Contents
# encoding: utf-8 module Sinatra module ProcessesHandler extend Hexacta def enable_processes p "Enabling processes..." get '/processes' do return "" if ProcessManager.instance.find(params[:class],authenticated(User).id).nil? content_type :json process = ProcessManager.instance.find(params[:class],authenticated(User).id) return { 'name' => process.name, 'progress' => process.progress }.to_json end post '/processes/:clazz' do |clazz| ProcessManager.instance.clean(clazz,authenticated(User).id) 200 end post '/process' do params[:user_id] = authenticated(User).id klass = Object.const_get("#{params[:class]}") a_handler = ProcessManager.instance.run(klass,params) a_handler.to_json end end end register ProcessesHandler end
Version data entries
54 entries across 54 versions & 1 rubygems