class Dog
def set_name(name)
@dogname = name
end
def get_name
return @dogname
end
def talk
return "awww"
end
def initialize(title, description)
@title = title
@description = description
end
end
#That will cause an error because your new method have two arguments.
doggy = Dog.new
bogart = Dog.new('The Book', 'The road not taken')
bogart.set_name('Sam')
puts bogart.get_name
puts bogart.talk
puts bogart.to_s
puts bogart.inspect
0
solved Initialize Ruby codes error