[Nitro] Raw::Element attribute accessors?

Robert Mela rob at robmela.com
Thu Sep 13 09:11:08 EDT 2007


Saw this in raw/lib/raw/compiler/filter/elements/element.rb

# class Box < Raw::Element
#   def render
#      %{
#      <div style="color: \#{#{@color}}">
#        #{content}
#      </div>
#      }
#   end

Wouldn't it be neater to include an attributes accessor on Element, so that

def render

 %{
*      <div style="color #{attrs[:color]}" >
*      </div>
   }
end

or better yet...

   <div style="color #{attribute_color}">
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rob.vcf
Type: text/x-vcard
Size: 116 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070913/cf63e16e/attachment.vcf 


More information about the Nitro-general mailing list