class DocAsset
% file: @DocAsset/DocAsset.m
    properties
        Description@char = '';
        CurrentValue@double = 0;
    properties (SetAccess = 'private')
        Date@char = date;   % Use date function to set initial value   
    properties (SetFunction = @localSetType);
        Type@char = 'savings';

% Class methods
    methods
        function a = DocAsset(description,type,current_value)
        % DocAsset Constructor function
            construct a % May not be necessary
            a.Description = description;
            a.Date = date;
            a.Type = type;
            a.CurrentValue = current_value;
        end % DocAsset

       function disp(a)
        % Display a DocAsset object
        fprintf('Description: %s\nDate: %s\nType: %s\nCurrent Value: $%9.2f\n',...
         a.Description,a.Date,a.Type,a.CurrentValue);
        end % disp
        
    methods (Access = 'public') % make private later
        function type = localSetType(obj,type)
            if ~(strcmpi(type,'bond') || strcmpi(type,'stock') || strcmpi(type,'savings'))
                error('Type must be either bond, stock, or savings')
            end
        end % localSetType
    
end % class   
    
