L
Larz
I was puzzled on this but figured out a way to do it. Figured I'd post
it on here, maybe there's a better way ..
class Test
@c = 2
def self.ctest
puts @c
end
def initialize(i)
@i = i
end
def itest
puts @i
# here's what I was trying to do !!!
puts self.class.ctest
end
end
ob = Test.new(7)
ob.itest
Test.ctest
it on here, maybe there's a better way ..
class Test
@c = 2
def self.ctest
puts @c
end
def initialize(i)
@i = i
end
def itest
puts @i
# here's what I was trying to do !!!
puts self.class.ctest
end
end
ob = Test.new(7)
ob.itest
Test.ctest