Class: RubyApp::Rack::Language

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_app/rack/language.rb

Instance Method Summary collapse

Constructor Details

#initialize(application) ⇒ Language

Returns a new instance of Language.



8
9
10
# File 'lib/ruby_app/rack/language.rb', line 8

def initialize(application)
  @application = application
end

Instance Method Details

#call(environment) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/ruby_app/rack/language.rb', line 12

def call(environment)
  RubyApp::Language.load!(RubyApp::Request.language)
  begin
    # RubyApp::Log.debug("LANGUAGE  #{RubyApp::Language.locale.code}")
    return @application.call(environment)
  ensure
    RubyApp::Language.unload!
  end
end