Method: Jig::XML.comment

Defined in:
lib/jig/xml.rb

.comment(*args) ⇒ Object

Construct an XML comment element.

Jig::XML.comment("This is a comment")

\<!-- This is a comment -->


319
320
321
322
323
324
325
326
# File 'lib/jig/xml.rb', line 319

def comment(*args)
  #:stopdoc:
  args.push(lambda{|*x| yield(*x) }) if block_given?
  args.push GAP if args.empty?
  jig = (Cache[:comment] ||= new("<!-- ".freeze, GAP, " -->\n".freeze).freeze)
  jig.plug(GAP, *args)
  #:startdoc:
end