Collection::Utl::Item - Base class for objects.


Collection documentation Contained in the Collection distribution.

Index


Code Index:

NAME

Top

Collection::Utl::Item - Base class for objects.

SYNOPSIS

Top

    use Collection::Utl::Item;
    our @ISA = qw( Collection::Utl::Item  );

DESCRIPTION

Top

Base class for objects.

SEE ALSO

Top

Collection::Utl::ActiveRecord, Collection, README

AUTHOR

Top

Zahatski Aliaksandr, <zag@cpan.org>

COPYRIGHT AND LICENSE

Top


Collection documentation Contained in the Collection distribution.
package Collection::Utl::Item;

use strict;
use warnings;
use strict;
use Carp;
use Data::Dumper;
use Collection::Utl::Base;
@Collection::Utl::Item::ISA     = qw(Collection::Utl::Base);
$Collection::Utl::Item::VERSION = '0.02';
attributes(qw/ _attr/);
sub init { return 1 };    #if suss

sub _init {
    my $self = shift;
    $self->_attr(shift);
    return $self->init(@_);
}

sub _get_attr {
    return $_[0]->_attr;
}

sub _changed {
    my $self = shift;
    my $rec  = $self->_attr();
    if ( ref $rec eq 'HASH' and my $obj = tied %$rec ) {
        return $obj->_changed;
    }
    else {
        carp ref($self) . "Not tied _attr";
    }
    return 0;
}

# Preloaded methods go here.

1;
__END__