From: Ittay Dror Date: 2008-07-14T20:04:34+09:00 Subject: [NEWBIE] Help with class instance variables Hello, The code below prints: # -- that is, the @arch, @os and @classifier are empty. (if i set these variables in the id method, they work fine) (Gem::Platform.local is a class method that creates a new Gem::Platform instance and returns it) thank you for your help, ittay code below: require 'rubygems' require 'rubygems/version' require 'rubygems/platform' module Platform class << self attr_reader :arch attr_reader :os attr_reader :classifier @arch = Gem::Platform.local.cpu @os = Gem::Platform.local.os @classifier = Gem::Platform.local.version def id "#{@arch}-#{@os}-#{@classifier}" end end end puts Gem::Platform.local.inspect puts Platform.id -- Posted via http://www.ruby-forum.com/.