Class: Idecoder::RunnersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Idecoder::RunnersController
- Defined in:
- app/controllers/idecoder/runners_controller.rb
Instance Method Summary collapse
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/idecoder/runners_controller.rb', line 14 def run begin fabrica = RunFactory.for(params['mode']) parser = CodeParser.new(params['code'], fabrica) data = parser.parse render json: {data: data, status: 200}, status: :ok rescue Exception => ex render json: {data: ex., status: 500}, status: :ok end end |
#test ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/idecoder/runners_controller.rb', line 8 def test @modes = RunFactory.list_types @mode = params['mode'] || "ruby" render layout: false end |