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
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

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




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 ="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