Class: Aladdin::App

Inherits:
Sinatra::Base
  • Object
show all
Extended by:
Support::OneOfPattern
Defined in:
lib/aladdin/app.rb

Overview

Sinatra app that serves the lesson preview. Should be able to use this in a config.ru file or as middleware. Authors should launch the app using the bin/aladdin executable.

Instance Method Summary collapse

Methods included from Support::OneOfPattern

one_of

Instance Method Details

#render_or_pass(&block) ⇒ Object

Calls the given block and invokes pass on error.



49
50
51
52
53
54
55
# File 'lib/aladdin/app.rb', line 49

def render_or_pass(&block)
  begin yield
  rescue Exception => e
    logger.error e.message
    pass
  end
end