diff options
author | dakkar <dakkar@thenautilus.net> | 2015-09-10 16:05:44 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2015-09-10 16:05:44 +0100 |
commit | 2b157d2d8d40107b8ad88d5c208604d49471e087 (patch) | |
tree | d93ce39a2e95b1bb38b54e4e927d86cb6f1f3b19 | |
parent | maybe I got deps working (diff) | |
download | WebCoso-p6-2b157d2d8d40107b8ad88d5c208604d49471e087.tar.gz WebCoso-p6-2b157d2d8d40107b8ad88d5c208604d49471e087.tar.bz2 WebCoso-p6-2b157d2d8d40107b8ad88d5c208604d49471e087.zip |
better coercion of lang for File
-rw-r--r-- | lib/WebCoso/File.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/WebCoso/File.pm b/lib/WebCoso/File.pm index 764cf2f..1a75e98 100644 --- a/lib/WebCoso/File.pm +++ b/lib/WebCoso/File.pm @@ -8,7 +8,9 @@ class WebCoso::File { $self.bless(:$path); } - submethod BUILD(Str(Cool) :$!lang, Str(Cool) :$!path) {} + submethod BUILD(:$lang, Str(Cool) :$!path) { + $!lang = $lang.Str if $lang.defined; + } multi method contents() { return $!contents //= $.parse(); |