Class: Hanami::View::Rendering::Subscope Private
- Inherits:
-
Scope
- Object
- LayoutScope
- Scope
- Hanami::View::Rendering::Subscope
- Defined in:
- lib/hanami/view/rendering/subscope.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Rendering subscope
Instance Method Summary collapse
-
#respond_to_missing?(m, _include_all) ⇒ TrueClass, FalseClass
private
Implements “respond to” logic.
Methods inherited from Scope
#format, #initialize, #inspect
Methods inherited from LayoutScope
#class, #format, #initialize, #inspect, #local, #locals, #render, #respond_to?, #view
Constructor Details
This class inherits a constructor from Hanami::View::Rendering::Scope
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object (protected)
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.
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/hanami/view/rendering/subscope.rb', line 32 def method_missing(m, *args, &block) ::Hanami::View::Escape.html( # FIXME: this isn't compatible with Hanami 2.0, as it extends a view # that we want to be frozen in the future # # See https://github.com/hanami/view/issues/130#issuecomment-319326236 if @locals.key?(m) @locals[m] else super end ) end |
Instance Method Details
#respond_to_missing?(m, _include_all) ⇒ TrueClass, FalseClass
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.
Implements “respond to” logic
24 25 26 |
# File 'lib/hanami/view/rendering/subscope.rb', line 24 def respond_to_missing?(m, _include_all) @locals.key?(m) end |