Environment for template evaluation.
Methods
Instance Public methods
Returns an array of things that the given block wants to append to the buffer. If the given block does not want to append to the buffer, then returns the result of invoking the given block inside an array.
# File lib/erbook/template.rb, line 100 def __block_content__ *block_args raise ArgumentError, 'block must be given' unless block_given? original = @buffer begin block_content = @buffer = [] return_value = yield(*block_args) # this appends content to @buffer ensure @buffer = original end if block_content.empty? [return_value] else block_content end end