From: dare ruby Date: 2008-04-07T16:09:12+09:00 Subject: how to create a product instance? Dear all, I have created a test file like, require 'product' product = Product.new('aaaa aaa', 'uuuu') I have passed two strings while initializing an object now in actual product class file class Product attr_accessor :name protected :name attr_accessor :description protected :description attr_accessor :categories protected :categories def initialize( *args ) # extract the attributes from the given arguments attributes = args.last.is_a?( ::Hash ) ? args.pop : {} # initialize attributes @name = attributes[ :name ] || String.new @description = attributes[ :description ] || String.new @categories = attributes[ :description ] || Array.new end end i have to used the arguments passed and get processed but i was not able to retrieve string using above initialize method. please suggest a way to proceed further. while testing iam getting only blank space for @name, @description, @categories. please suggest a way so that ican read my arguments in product class using above same initialize method. thanks in advance Regards, Jose martin -- Posted via http://www.ruby-forum.com/.