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
Thanks in advance:)
--
Posted via http://www.ruby-forum.com/.
|
|
0
|
|
|
|
Reply
|
Atheeq
|
1/18/2010 9:41:56 PM |
|
El Lunes, 18 de Enero de 2010, Atheeq Pasha escribi=C3=B3:
> Hello,
>=20
> how to use Integer class in ruby?? When I enter this from irb console,
> this error is thrown out..
>=20
> >>Integer.new(3)
>=20
> NoMethodError: undefined method `new' for Integer:Class
> from (irb):182
Integer doesn't allow "new" method as Integer is an especial class (Integer=
1=20
has a fixed ibject_id, as 2, 3 and so on).
To create a Fixnum 3 just do:
irb> 3
=2D-=20
I=C3=B1aki Baz Castillo <ibc@aliax.net>
|
|
0
|
|
|
|
Reply
|
utf
|
1/18/2010 9:48:20 PM
|
|
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/.
|
|
0
|
|
|
|
Reply
|
Atheeq
|
1/18/2010 9:53:07 PM
|
|
On Mon, Jan 18, 2010 at 4:53 PM, Atheeq Pasha <atheeq@carmatec.com> wrote:
> I=F1aki Baz Castillo wrote:
>> El Lunes, 18 de Enero de 2010, Atheeq Pasha escribi=F3:
>>> 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
>>> =A0 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
>
> =A0manager =3D Manager.new(:Host =3D> result.address)
> =A0 =A0 =A0 varbind =3D
> VarBind.new(oid.to_s+'.'+result.reset_port.to_s,Integer.new(3))
> =A0 =A0 =A0 manager.set(varbind)
>
> Where i get this error..
Try:
manager =3D Manager.new(:Host =3D> result.address)
varbind =3D VarBind.new("#{oid}.#{result.reset_port}", 3)
manager.set(varbind)
|
|
0
|
|
|
|
Reply
|
brabuhr
|
1/18/2010 10:23:18 PM
|
|
|
3 Replies
340 Views
(page loaded in 0.08 seconds)
Similiar Articles: Integer class error - comp.lang.rubyOn Mon, Jan 18, 2010 at 4:53 PM, Atheeq Pasha <atheeq@carmatec.com> wrote: > I=F1aki Baz Castillo wrote: >> El Lunes, 18 de Enero de 2010, Atheeq Pasha escribi=F3 ... error:Attempted to access F2(6); index must be a positive integer ...Integer class error - comp.lang.ruby error:Attempted to access F2(6); index must be a positive integer ... Integer class error - comp.lang.ruby... get associated with the ... Error Rate Calculations with Hamming Code Encoder/Decoder - comp ...Hi All, For a class project, I am attempting to build a transmission system which uses the Bernoulli Binary Integer (M=16) block as source input. ... ??? Attempted to access e(1,0); index must be a positive integer ...Integer class error - comp.lang.ruby Attempted to access e(1,0); index must be a positive integer ... Attempted to access e(1,0); index must be a positive integer or ... How to get integer value for register contents ? - comp.lang ...Integer class error - comp.lang.ruby How to get integer value for register contents ? - comp.lang ... Integer class error - comp.lang.ruby How to get integer value for ... Attempted to access A(0); index must be a positive integer or ...Integer class error - comp.lang.ruby Integer class error - comp.lang.ruby index must be a positive integer or logical. - comp.soft-sys ... Integer class error - comp.lang ... Solution to "cannot instantiate abstract class due to following ...... see declaration of 'getNumber' testcpp.cpp(38) : error C2259: 'C' : cannot instantiate abstract class ... How can I instantiate a class inside another class Follow ... int x ... Calculation of Bit Error Rate - comp.soft-sys.matlabIt is required to evaluate the link performance by symbol error calculation. ... hamming code - comp.soft-sys.matlab Integer class error - comp.lang.ruby Error Rate ... Static const integral data members can be initialized? - comp.lang ...Why do Microsoft C++ Compiler reports: error C2864: 'obj::y' : only static const integral data members can be initialized within a class floa... What is Difference between const int i and int const i - comp.lang ...Integer class error - comp.lang.ruby const member functions in classes ... What is Difference between const int i and int const i - comp.lang ... const member functions in ... Integer class error - comp.lang.ruby | Computer GroupOn Mon, Jan 18, 2010 at 4:53 PM, Atheeq Pasha <atheeq@carmatec.com> wrote: > I=F1aki Baz Castillo wrote: >> El Lunes, 18 de Enero de 2010, Atheeq Pasha escribi=F3 ... Error Classes, Error Codes, and Error Handlers - MCS Division :: Homeint MPI_Add_error_class(int *errorclass) MPI_ADD_ERROR_CLASS(ERRORCLASS, IERROR) INTEGER ERRORCLASS, IERROR . int MPI::Add_error_class() Creates a new error class and ... 7/26/2012 6:21:23 PM
|