Ruby - Classes and Objects
How can you modify this class to add an instance method age_in_months that returns the age in months?
class Person
def initialize(age)
@age = age
end
endHow can you modify this class to add an instance method age_in_months that returns the age in months?
class Person
def initialize(age)
@age = age
end
end@age, so use it inside the method.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions