# File lib/mab/mixin.rb, line 170 def mab(&blk) prev = defined?(@mab_context) && @mab_context ctx = @mab_context = Context.new res = instance_eval(&blk) ctx.empty? ? res : ctx.join ensure @mab_context = prev end
# File lib/mab/mixin.rb, line 179 def mab_insert(tag) ctx = @mab_context || raise(Error, 'mab { }-block required') ctx << tag end
# File lib/mab/mixin.rb, line 187 def mab_options @mab_options ||= {} end
# File lib/mab/mixin.rb, line 151 def mab_tag(name) ctx = @mab_context || raise(Error, "Tags can only be written within a `mab { }`-block") tag = Tag.new(name, mab_options, ctx, self) mab_insert(tag) tag end
# File lib/mab/mixin.rb, line 158 def tag!(name, *args, &blk) mab_tag(name)._insert(*args, &blk) end
Generated with the Darkfish Rdoc Generator 2.