Method: Volt.in_app

Defined in:
lib/volt.rb

.in_appObject

Runs code in the context of this app.



67
68
69
70
71
72
73
74
75
76
# File 'lib/volt.rb', line 67

def in_app
  previous_app = Thread.current['volt_app']
  Thread.current['volt_app'] = self

  begin
    yield
  ensure
    Thread.current['volt_app'] = previous_app
  end
end