Use attr_accessor to add a new attribute and set it
class Employee attr_accessor :name def initialize @name = "" end end employee1 = Employee.new employee1.name = "Aneesha" puts employee1.name