summaryrefslogtreecommitdiffstats
path: root/.vim/UltiSnips/perl.snippets
diff options
context:
space:
mode:
Diffstat (limited to '.vim/UltiSnips/perl.snippets')
-rw-r--r--.vim/UltiSnips/perl.snippets12
1 files changed, 7 insertions, 5 deletions
diff --git a/.vim/UltiSnips/perl.snippets b/.vim/UltiSnips/perl.snippets
index b480482..61d9a83 100644
--- a/.vim/UltiSnips/perl.snippets
+++ b/.vim/UltiSnips/perl.snippets
@@ -1,12 +1,14 @@
snippet new
-sub new {
- my $class = shift;
+method new($class: $deps = {}) {
+ ${0}
+ return $class->new_no_defaults($deps);
+}
+method new_no_defaults($class: $deps = {}) {
my $self = {};
bless $self, $class;
-
- ${0}
-
+ $self->{deps} = $deps;
return $self;
}
+
endsnippet