E
Eric C.
Hi:
I'm writing a class where I need to know the class's name inside a class
method:
class MyClass
def instance_method
puts self.class.name # => "MyClass"
end
def self.class_method
self.class.name # => Undefined
how can I get class.name here?
end
end
Thanks,
Eric
I'm writing a class where I need to know the class's name inside a class
method:
class MyClass
def instance_method
puts self.class.name # => "MyClass"
end
def self.class_method
self.class.name # => Undefined
how can I get class.name here?
end
end
Thanks,
Eric