bump version to 0.26
[gitmo/MooseX-Types.git] / lib / MooseX / Types / TypeDecorator.pm
index a94c5c3..b95f124 100644 (file)
@@ -1,4 +1,5 @@
 package MooseX::Types::TypeDecorator;
+our $VERSION = "0.26";
 
 use strict;
 use warnings;
@@ -10,6 +11,11 @@ use Moose::Meta::TypeConstraint::Union;
 use Scalar::Util qw(blessed);
 
 use overload(
+    '0+' => sub {
+            my $self = shift @_;
+            my $tc = $self->{__type_constraint};
+            return 0+$tc;
+     },
     '""' => sub {
                my $self = shift @_;
                if(blessed $self) {
@@ -18,6 +24,7 @@ use overload(
                        return "$self";
                }
     },
+    bool => sub { 1 },
     '|' => sub {
         
         ## It's kind of ugly that we need to know about Union Types, but this
@@ -194,7 +201,6 @@ sub AUTOLOAD {
     ## MooseX::Types::UndefinedType which AUTOLOADs during autovivication.
     
     my $return;
-    
     eval {
         $return = $self->__type_constraint->$method(@args);
     }; if($@) {