lib/wrapt/layout.rb
# Wraps the given content into the layout using the same base
# as the layouter currently has
#
# @params [String] content The content to form the main body of the layout
# @params [Hash] opts an options hash
# @option opts [String|Symbol] :layout the name of a layout template to use
# @option opts [String|Symbol] :format the format of the layout template to use
# @api public
Wraps the given content into the layout using the same base
as the layouter currently has
Wraps the given content into the layout using the same base as the layouter currently has
def wrap(content, opts={})
      layout = self.dup
      layout.format         = opts[:format] if opts[:format]
      layout.template_name  = opts[:layout] if opts[:layout]
      layout.content = content
      layout.render_layout(false)
    end
def wrap ( content , opts = { } ) layout = self . dup layout . format = opts [ :format ] if opts [ :format ] layout . template_name = opts [ :layout ] if opts [ :layout ] layout . content = content layout . render_layout ( false ) end
Wraps the given content into the layout using the same base
as the layouter currently has
Wraps the given content into the layout using the same base as the layouter currently has
content
opts
:format the format of the layout template to use
: format the format of the layout template to use
params
[String] content The content to form the main body of the layout
[ String ] content The content to form the main body of the layout
params
[Hash] opts an options hash
[ Hash ] opts an options hash
api
None