From: Marc-antoine Kruzik Date: 2009-09-05T20:29:55+09:00 Subject: something.new( :attribute => value) thing Hello, I saw something very interesting in the code of FXRuby, and I would like to use this kind of code in my scripts : My_Window.new(app, "Button Test", :opts => DECOR_ALL, :x => 100, :y => 100) I'm only able to do "classic" initialisations, such as : My_Window.new(app, "Button Test", DECOR_ALL, 100, 100) What is the easiest way to create class which use the ":opts => ... x => ... y => " part ? I'm sorry, I don't know the name of this feature, so it's quite difficult to find informations about it. I wrote a code to use for sample. class My_Window attr_accessor :application attr_accessor :title # Do I have to create attributes ? attr_accessor :opts attr_accessor :x attr_accessor :y def initialize(application, title, ??? ) @application = application @title = title ??? end end Thanks ! -- Posted via http://www.ruby-forum.com/.