Sha256: df520e97b27abb1e52d6a02a8173c8688cc2c9e57353b88856d2e0a71e8180f5
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
require 'lotus/view/rendering/layout_scope' require 'lotus/view/rendering/template' require 'lotus/view/rendering/partial' module Lotus module View module Rendering # Rendering scope # # @since 0.1.0 # # @see Lotus::View::Rendering::LayoutScope class Scope < LayoutScope # Initialize the scope # # @param view [Class] the view # @param locals [Hash] a set of objects available during the rendering # @option locals [Symbol] :format the requested format # # @api private # @since 0.1.0 def initialize(view, locals = {}) @view, @locals = view, locals end # Returns the requested format. # # @return [Symbol] the requested format (eg. :html, :json, :xml, etc..) # # @since 0.1.0 def format locals[:format] end protected def method_missing(m) if @view.respond_to?(m) @view.__send__ m elsif @locals.key?(m) @locals[m] else super end end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lotus-view-0.1.0 | lib/lotus/view/rendering/scope.rb |