]> git.donarmstrong.com Git - debbugs.git/blobdiff - Debbugs/OOBase.pm
Merge branch 'mouseify'
[debbugs.git] / Debbugs / OOBase.pm
diff --git a/Debbugs/OOBase.pm b/Debbugs/OOBase.pm
new file mode 100644 (file)
index 0000000..6600e02
--- /dev/null
@@ -0,0 +1,48 @@
+# This module is part of debbugs, and
+# is released under the terms of the GPL version 2, or any later
+# version (at your option). See the file README and COPYING for more
+# information.
+# Copyright 2018 by Don Armstrong <don@donarmstrong.com>.
+
+package Debbugs::OOBase;
+
+=head1 NAME
+
+Debbugs::OOBase -- OO Base class for Debbugs
+
+=head1 SYNOPSIS
+
+
+=head1 DESCRIPTION
+
+
+
+=cut
+
+use Mouse;
+use strictures 2;
+use namespace::autoclean;
+
+has schema => (is => 'ro', isa => 'Object',
+              required => 0,
+              predicate => 'has_schema',
+             );
+
+sub schema_argument {
+    my $self = shift;
+    if ($self->has_schema) {
+        return (schema => $self->schema);
+    } else {
+       return ();
+    }
+}
+
+__PACKAGE__->meta->make_immutable;
+
+1;
+
+__END__
+# Local Variables:
+# indent-tabs-mode: nil
+# cperl-indent-level: 4
+# End: