lib/hanami/view/rendering/scope.rb in hanami-view-1.1.0 vs lib/hanami/view/rendering/scope.rb in hanami-view-1.1.1

- old
+ new

@@ -4,11 +4,11 @@ require 'hanami/view/rendering/partial' module Hanami module View module Rendering - # Rendering scope + # Rendering view scope # # @since 0.1.0 # # @see Hanami::View::Rendering::LayoutScope class Scope < LayoutScope @@ -64,10 +64,11 @@ @view.respond_to?(m, include_all) || @locals.key?(m) end protected + # @api private 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 @@ -82,9 +83,16 @@ end ) end private + + # @since 1.1.1 + # @api private + def _options(options) + current_locals = locals.reject { |key, _| @view.respond_to?(key) } + Options.build(options, current_locals, format) + end # @since 0.4.2 # @api private def layout if @view.class.respond_to?(:layout)