From: Phlip Date: 2009-03-24T21:12:02+09:00 Subject: Props - Nokogiri's Builder notation has class and ID shortcuts Rubies: This is just a note to document a nice discovery in Nokogiri's tests: builder = Nokogiri::HTML::Builder.new do div.rad.thing! { text "" b "hello" } end assert_equal( '
<awesome>hello
', builder.doc.root.to_html.gsub(/\n/, '')) The Builder notation div.rad.thing! expanded to
. This implies .rad, without a bang, expands to class="rad", and .thing!, with the bang, expands to an ID. (-8 -- Phlip