in Ruby can I automatically populate instance variables somehow in the initialize method?
For example if I had:
class Weekend
attr_accessor :start_date, :end_date, :title, :description, :location
def initialize(params)
# SOMETHING HERE TO AUTO POPULATE INSTANCE VARIABLES WITH APPROPRIATE PARAMS
end
end
You can use
instance_variable_setlike this: