Module: ActiveDecorator::ViewContext
- Defined in:
- lib/active_decorator/view_context.rb
Defined Under Namespace
Modules: Filter
Class Method Summary collapse
- .current ⇒ Object
- .pop ⇒ Object
- .push(view_context) ⇒ Object
- .run_with(view_context) ⇒ Object
- .view_context_stack ⇒ Object
Class Method Details
.current ⇒ Object
6 7 8 |
# File 'lib/active_decorator/view_context.rb', line 6 def current view_context_stack.last end |
.pop ⇒ Object
14 15 16 |
# File 'lib/active_decorator/view_context.rb', line 14 def pop view_context_stack.pop end |
.push(view_context) ⇒ Object
10 11 12 |
# File 'lib/active_decorator/view_context.rb', line 10 def push(view_context) view_context_stack.push view_context end |
.run_with(view_context) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/active_decorator/view_context.rb', line 22 def run_with(view_context) push view_context yield ensure pop end |
.view_context_stack ⇒ Object
18 19 20 |
# File 'lib/active_decorator/view_context.rb', line 18 def view_context_stack Thread.current[:active_decorator_view_contexts] ||= [] end |