It's part of my continual effort to combine minimialism with readability 
in my code.
Here's the snippet of code which is affected:
____________________________
class XL; end
WIN32OLE.const_load( excel, XL )

#Purdy it up

#Align left 2 columns to left
sht.range('A:B').HorizontalAlignment = XL::XlLeft

#Add a thin grid
( Consts = [ XL::XlEdgeLeft, XL::XlEdgeTop, XL::XlEdgeBottom, 
XL::XlEdgeRight, XL::XlInsideVertical, XL::XlInsideHorizontal ] ).each { 
|const| sht.usedrange.Borders( const ).weight = XL::XlThin }
____________________________

"XL" as a class name is my own attempt at simplifying the original 
"ExcelConst". I was just wondering whether I could use these constants 
without repeating "XL::" all the time. I don't know how to make them 
"main" constants, and I assumed that that sort of thing would be bad 
practice anyway.

This is more about trying to work with Excel's awkward API, and the way 
it insists on specifying every border of every cell as a seperate 
constant.

-- 
Posted via http://www.ruby-forum.com/.