Answer the question
In order to leave comments, you need to log in
Find out the real class of an object
class Klass
def class
String
end
def type
String
end
def answer
42
end
end
k = Klass.new
puts k.class
puts k.type
puts k.answer
=> String
=> String
=> 42
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question