package Prefs;

# Dobrica Pavlinusic, <dpavlin@rot13.org> 07/31/07 16:31:41 CEST

use strict;
use warnings;

use Carp qw/cluck/;
use Data::Dump qw/dump/;

use base qw(Class::Accessor);
# Screen
my @names = qw(scale show_mem);
# Orao
push @names, qw(debug trace);
warn "# Prefs names defined: ",join(",",@names),"\n";
__PACKAGE__->mk_accessors(@names);

=head1 Preferences

=head2 names

  @names = Prefs->names;

=cut

sub names { return @names };

=head2 prefs;

  print prefs( Prefs->dump );

=cut

sub prefs {
	my $self = shift || die "no self?";
	my $prefs;
	foreach my $p ( @names ) {
		$prefs->{$p} = $self->$p;
	}

	warn "## prefs = ",dump( $prefs ) if $self->debug;
	return $prefs;
}


1;
