Write code which writes code with Send
Send allows you to call a method identified by a symbol.
My app has classes for people and events. Each class has different attributes.
class Personattr_accessor :nameendclass Eventattr_accessor :titleend
I also have a module which sets up the objects.
module Setupdef init(name_or_title)endend
Exercise - Send a little love
Include the Setup module in the Person and Item classes. Now write the init method. use respond_to? and send to initialise either the name or title.
Start with an array [:name, :title], then iterate over it, checking if the object responds to the methods, then call the method when you get a result.