Say I have a class with many attributes but need only one attribute at a time, i.e.
class A attr_accessor :name attr_accessor :other1 attr_accessor :other2 attr_accessor :other3 attr_accessor :other4 end
And want the output of only one attribute at a time:
a = A.new puts a.name.to_str
to be:
name value of a: value_of_name
What is the best way of doing this?