Separate out App::IdiotBox::* DB objects and put create/update
[catagits/App-IdiotBox.git] / lib / App / IdiotBox / Clonable.pm
CommitLineData
f29e9b6f 1package App::IdiotBox::Clonable;
2
3use Moo::Role;
4
5sub clone {
6 my $obj = shift;
7
8 my $class = ref $obj;
9
10 my %copy;
11
12 for my $f ($obj->fields) {
13 $copy{$f} = $obj->$f,
14 };
15
16 return bless \%copy, $class;
17}
18
191;