K
kazaam
Hi,
I have a codeblock like this:
def foobar(command,customerrormessage)
if not system(command)
puts customerrormessage
exit
end
end
and then many calls of it like:
foobar('rm something','Error I could'nt remove something')
foobar('apt-get install thishere','Error while installing the packet')
foobar('module-assistant a-i mymodule','Error while installing the module')
[..]
In pascal I would simply create a multi-dimensional array[x,y] and fill it with the commands and the corresponding error-messages but how to do this in ruby? There are no arrays like the mentioned on or? Or do you have a even better solution for this?
greets
I have a codeblock like this:
def foobar(command,customerrormessage)
if not system(command)
puts customerrormessage
exit
end
end
and then many calls of it like:
foobar('rm something','Error I could'nt remove something')
foobar('apt-get install thishere','Error while installing the packet')
foobar('module-assistant a-i mymodule','Error while installing the module')
[..]
In pascal I would simply create a multi-dimensional array[x,y] and fill it with the commands and the corresponding error-messages but how to do this in ruby? There are no arrays like the mentioned on or? Or do you have a even better solution for this?
greets