Class: Shaven::Transformer::Dummy
- Defined in:
- lib/shaven/transformers/dummy.rb
Overview
It removes all nodes containing rb:dummy
attribute. It’s very usefull when your template contains lot of example items. Instead of deleting them manualy you can mark them as dummy, so your designer can in the future edit templates directly in application.
Example
<ul id="emperors">
<li rb="emperors">Karol the Great</li>
<li rb:dummy="yes">Julius Cesar</li>
<li rb:dummy="yes">Alexander the Great</li>
<ul>
Instance Method Summary collapse
Instance Method Details
#transform! ⇒ Object
17 18 19 |
# File 'lib/shaven/transformers/dummy.rb', line 17 def transform! node.remove end |