%w( . lib ../lib ).each{|d| $:.unshift d} require 'attributes' class C attributes %w( a b c ) def initialize(*args) self.class.writer_attributes.each do |at| send at, args.shift end end end obj = C::new 0,1,2 p obj.a p obj.b p obj.c