From: Aleksei Guzev Date: 2001-07-19T22:59:03+09:00 Subject: [ruby-talk:18118] RE: Delphi like properties ? You really missed methods "prop" and "prop=" class A def p return @b * 10 end def p=( v ) @b = v / 10 return v end def b return @b end end This would define property p wich is ten times larger than b :) # -----Original Message----- # From: Lothar Scholz [mailto:llothar@mailandnews.de] # Sent: 19 ???? 2001 ?. 19:41 # To: ruby-talk ML; undisclosed-recipients: # Subject: [ruby-talk:18116] Delphi like properties ? # # # I want to implement a C extension for a GUI toolkit that # supports the same magic properties like delphi. # # But how can i define a getter/setter function. I found the # # "rb_define_virtual_variable" # # but this is only for global variables not for instance variables. # # Have i missed something or is it just not possible. # And if not wouldn't it nice to have ? # # Thanks, # # Lothar #