Initialize three attributes
class Person
attr_reader :name, :age, :occupation
def initialize(name, age, occupation)
@name, @age, @occupation = name, age, occupation
end
def isIn?
true
end
end
jimmy = Person.new('J', 21, 'reporter')
clark = Person.new('C', 35, 'reporter')
jimmy.isIn? # => true
clark.isIn? # => true
Related examples in the same category