Class: Locomotive::Steam::Middlewares::ThreadSafe
- Inherits:
-
Object
- Object
- Locomotive::Steam::Middlewares::ThreadSafe
- Defined in:
- lib/locomotive/steam/middlewares/thread_safe.rb
Direct Known Subclasses
Auth, EntrySubmission, Locale, LocaleRedirection, Page, PrivateAccess, Redirection, Renderer, Site, Sitemap, TemplatizedPage, Timezone, UrlRedirection
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
Instance Method Summary collapse
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
6 7 8 |
# File 'lib/locomotive/steam/middlewares/thread_safe.rb', line 6 def env @env end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/locomotive/steam/middlewares/thread_safe.rb', line 8 def call(env) threadsafed = dup threadsafed.env = env threadsafed._call threadsafed.next end |
#next ⇒ Object
17 18 19 20 |
# File 'lib/locomotive/steam/middlewares/thread_safe.rb', line 17 def next # avoid to be called twice @next_response || (@next_response = app.call(env)) end |