I’m looking over some open-source code and can’t wrap my head around this snippet.
class Something
def self.smart
new.smart
end
def smart
"test"
end
end
class Other < Something
println Other.smart
Is the code trying to instantiate a new instance every time smart is called?
is equivalent to
staticmethod, which can e accessed by using class name.and
is equivalent to
instancemethod, need object to accessnew is same as the in java, created an instance of class.
and the whole thing is equivalent to.