# Props - Nokogiri's Builder notation has class and ID shortcuts

**URL:** <https://www.ruby-forum.com/t/props-nokogiris-builder-notation-has-class-and-id-shortcuts/163729>\
**Category:** Ruby\
**Created:** [March 24, 2009, 1:16pm UTC](https://www.ruby-forum.com/t/props-nokogiris-builder-notation-has-class-and-id-shortcuts/163729 "2009-03-24T13:16:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed8c4c/32.png) [@Phlip](https://www.ruby-forum.com/u/Phlip)\
**Post date:** [March 24, 2009, 1:16pm UTC](https://www.ruby-forum.com/t/props-nokogiris-builder-notation-has-class-and-id-shortcuts/163729/1 "2009-03-24T13:16:21Z")

</div>

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 "<awesome>"
         b "hello"
       }
     end
     assert_equal(
       '<div class="rad" 

```

id=“thing”\>\<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
