Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

Ruby Programming
Previous Page Home Next Page

Getting and Setting Properties

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.
Ruby Programming
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire