I
Iñaki Baz Castillo
Hi, let's imagine a method "my_method()" whic allows any number of paramete=
rs.=20
And I need to create those parameters list in the following way:
lalalala =3D false
if lalalala
params =3D ":user, 'alice', 1456"
else
params =3D ":user, 0000"
end
After it I must invoke the method with "params" string as parameters.
I expected that the following could work but it fails:
my_object.my_method(eval(params))
=3D> SyntaxError: (eval):1: syntax error, unexpected ',', expecting $end
:user, 0000
^
So I don't understand how to use eval to achieve it. Any help please? Thank=
s a=20
lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>
rs.=20
And I need to create those parameters list in the following way:
lalalala =3D false
if lalalala
params =3D ":user, 'alice', 1456"
else
params =3D ":user, 0000"
end
After it I must invoke the method with "params" string as parameters.
I expected that the following could work but it fails:
my_object.my_method(eval(params))
=3D> SyntaxError: (eval):1: syntax error, unexpected ',', expecting $end
:user, 0000
^
So I don't understand how to use eval to achieve it. Any help please? Thank=
s a=20
lot.
=2D-=20
I=C3=B1aki Baz Castillo <[email protected]>