Hello Marcin,
> self.class.to_s should work
>
>
Sorry this return me the class name itself not the instance name?
e.g.
#!/usr/bin/env ruby
class Investment
def initialize
puts "I'am ALIVE!"
iname=self.class.to_s
puts "Instance Name: #{iname}"
end
end
_Invest = Investment.new
puts _Invest.class
give me:
I'am ALIVE!
Instance Name: Investment
Investment
and not "Instance Name: _Invest" as am looking for.
Tx,
r.