Class: Lotus::View::Rendering::Scope
- Inherits:
-
LayoutScope
- Object
- LayoutScope
- Lotus::View::Rendering::Scope
- Defined in:
- lib/lotus/view/rendering/scope.rb
Overview
Rendering scope
Instance Method Summary collapse
-
#format ⇒ Symbol
Returns the requested format.
-
#initialize(view, locals = {}) ⇒ Scope
constructor
private
Initialize the scope.
Methods inherited from LayoutScope
Constructor Details
#initialize(view, locals = {}) ⇒ Scope
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize the scope
22 23 24 |
# File 'lib/lotus/view/rendering/scope.rb', line 22 def initialize(view, locals = {}) @view, @locals = view, locals end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m) ⇒ Object (protected)
36 37 38 39 40 41 42 43 44 |
# File 'lib/lotus/view/rendering/scope.rb', line 36 def method_missing(m) if @view.respond_to?(m) @view.__send__ m elsif @locals.key?(m) @locals[m] else super end end |
Instance Method Details
#format ⇒ Symbol
Returns the requested format.
31 32 33 |
# File 'lib/lotus/view/rendering/scope.rb', line 31 def format locals[:format] end |