Sha256: 692ee5d350b511a410c42bb5d9a0aaf4d281f7ae4a096c97a3fce6c0c1c40fe3
Contents?: true
Size: 796 Bytes
Versions: 8
Compression:
Stored size: 796 Bytes
Contents
module Munge module Helpers module Capture def capture(&block) if block.binding.local_variable_defined?(:_erbout) original_erbout = block.binding.local_variable_get(:_erbout) block.binding.local_variable_set(:_erbout, "") captured_text = yield block.binding.local_variable_set(:_erbout, original_erbout) captured_text else yield end end def append_to_erbout(block_binding, text) if block_binding.local_variable_defined?(:_erbout) original_erbout = block_binding.local_variable_get(:_erbout) updated_erbout = original_erbout + text block_binding.local_variable_set(:_erbout, updated_erbout) end text end end end end
Version data entries
8 entries across 8 versions & 1 rubygems