summaryrefslogtreecommitdiff
path: root/lib/Enigmatic/Role
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Enigmatic/Role')
-rw-r--r--lib/Enigmatic/Role/WithWiring.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Enigmatic/Role/WithWiring.pm b/lib/Enigmatic/Role/WithWiring.pm
new file mode 100644
index 0000000..df6dc48
--- /dev/null
+++ b/lib/Enigmatic/Role/WithWiring.pm
@@ -0,0 +1,17 @@
+package Enigmatic::Role::WithWiring;
+use DAKKAR::p 'role';
+
+requires 'BUILDARGS';
+requires 'wiring';
+
+around BUILDARGS => sub {
+ my $orig = shift;
+ my $class = shift;
+
+ if ( @_ == 1 && !ref $_[0] ) {
+ return $class->$orig( wiring => $_[0] );
+ }
+ else {
+ return $class->$orig(@_);
+ }
+};