U
Une Bévue
I'd like having a class method called only one time ?
Is it possible ?
suppose i do have a class "HFSFile" and i need to know the host ip.
i don't want to call the method giving host ip each time i need it but
only the first time even i do instantiate several HFSFile, mostly
because it's time consuming :
@h[:host_ip] = `curl -s http://whatismyip.org`.chomp
it is even in a while loop because sometimes curl returns ''.
Is it possible ?
suppose i do have a class "HFSFile" and i need to know the host ip.
i don't want to call the method giving host ip each time i need it but
only the first time even i do instantiate several HFSFile, mostly
because it's time consuming :
@h[:host_ip] = `curl -s http://whatismyip.org`.chomp
it is even in a while loop because sometimes curl returns ''.