"MaurùÄio" <briqueabraque / yahoo.com> writes:

> Hi,
> 
>     I'm using Ruby with WIN32OLE. I've created an OLE object that has a
> property named "type". I want to see it's value but, when I try, I get:
> 
> irb(main):008:0> element.type
> WIN32OLE

>     How can I access the value of the "type" property (in this example, it's
> supposed to be 25) instead of WIN32OLE?

This calls the #type method inherited from Object. If you want to
override it, then do this:

alias_method :orig_type :type
def element.type
  element['type']
end
def element.type=(newType)
  element['type']=newType
end

so, when called:
> element.type
25
> element.orig_type
WIN32OLE
> element.type = 5
5
> element.type
5


YS.