Module: Padrino::Helpers::OutputHelpers::SinatraCurrentEngine

Defined in:
padrino-helpers/lib/padrino-helpers/output_helpers.rb

Overview

Module used to detect the current engine in vanilla Sinatra apps.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_engineObject (readonly)

Returns the value of attribute current_engine.



29
30
31
# File 'padrino-helpers/lib/padrino-helpers/output_helpers.rb', line 29

def current_engine
  @current_engine
end

Instance Method Details

#render(engine) ⇒ Object



31
32
33
34
35
36
# File 'padrino-helpers/lib/padrino-helpers/output_helpers.rb', line 31

def render(engine, *)
  @current_engine, engine_was = engine, @current_engine
  output = super
  @current_engine = engine_was
  output
end