You can set and get
properties from the server using normal
Ruby hash notation. For example, to set the
Rotation
property
in an Excel chart, you might write
excel = WIN32OLE.new("excel.application")
excelchart = excel.Charts.Add()
...
excelchart['Rotation'] = 45
puts excelchart['Rotation']
|
An OLE object's parameters are automatically set up as attributes of
the
WIN32OLE
object. This means that you can set a parameter by
assigning to an object attribute.
excelchart.rotation = 45
r = excelchart.rotation
|
Because these attributes are conventional Ruby accessor
methods, attribute names cannot start with a capital letter.
In this example, we have to use
rotation
instead of
Rotation
.