use attr_accessor instead of defining the methods manually