From: Atheeq Pasha Date: 2010-01-19T06:53:07+09:00 Subject: Re: Integer class error I単aki Baz Castillo wrote: > El Lunes, 18 de Enero de 2010, Atheeq Pasha escribi坦: >> Hello, >> >> how to use Integer class in ruby?? When I enter this from irb console, >> this error is thrown out.. >> >> >>Integer.new(3) >> >> NoMethodError: undefined method `new' for Integer:Class >> from (irb):182 > > Integer doesn't allow "new" method as Integer is an especial class > (Integer 1 > has a fixed ibject_id, as 2, 3 and so on). > > To create a Fixnum 3 just do: > > irb> 3 I am using this in snmpset implementation of the SNMP ruby manager = Manager.new(:Host => result.address) varbind = VarBind.new(oid.to_s+'.'+result.reset_port.to_s,Integer.new(3)) manager.set(varbind) Where i get this error.. -- Posted via http://www.ruby-forum.com/.