public function getBuffer(array $options = [])
    {
        $docEol  = $this->Document->eol;
        $options = Hash::merge(['safe' => true], $options);

        if (Arr::key('block', $options)) {
            unset($options['block']);
        }

        if (count($this->_buffers)) {
            $scripts = $docEol .
                'jQuery (function($) {'  . $docEol .
                implode($docEol, $this->_buffers) . $docEol .
                '});' . $docEol;

            return $this->Html->scriptBlock($scripts, $options) . $docEol;
        }

        return null;
    }