Module: Tiny::HamlTemplating

Includes:
Buffering, Markup
Included in:
Helpers
Defined in:
lib/tiny.rb

Overview

Provides support for using Tiny helpers within a HAML template.

Instance Method Summary collapse

Methods included from Markup

#cdata, #comment, #doctype, #html_tag

Methods included from Buffering

#append, #append!, #raw

Instance Method Details

#with_buffer(*args) {|*args| ... } ⇒ String

Extracts a section of a HAML template or buffers a block not originated from an HAML template. Akin to Rails capture method.

Parameters:

  • args (any)

    n number of arguments to be passed to block evaluation.

Yields:

  • (*args)

    HAML block or content block.

Returns:

See Also:



282
283
284
# File 'lib/tiny.rb', line 282

def with_buffer(*args, &block)
  defined?(Haml) && Haml::Helpers.block_is_haml?(block) ? capture_haml(*args, &block) : super
end