« blib/lib/Gapp/Moose/Meta/Attribute/Trait/GappDateEntry.pm
↑ Summary
blib/lib/Gapp/Moose/Meta/Attribute/Trait/GappDialog.pm »
| 1 | package Gapp::Meta::Attribute::Trait::GappDefault; | ||
| 2 | { | ||
| 3 | $Gapp::Meta::Attribute::Trait::GappDefault::VERSION = '0.60'; | ||
| 4 | } | ||
| 5 | use Moose::Role; | ||
| 6 | |||
| 7 | use MooseX::Types::Moose qw( ArrayRef HashRef ); | ||
| 8 | |||
| 9 | before '_process_options' => sub { | ||
| 10 | my $class = shift; | ||
| 11 | my $name = shift; | ||
| 12 | my $options = shift; | ||
| 13 | |||
| 14 | my @handles = qw( destroy hide present show show_all signal_connect signal_emit ); | ||
| 15 | |||
| 16 | if ( is_ArrayRef( $options->{handles} ) ) { | ||
| 17 | push @{ $options->{handles} }, @handles; | ||
| 18 | } | ||
| 19 | elsif ( is_HashRef( $options->{handles} ) ) { | ||
| 20 | map { $options->{handles}{$_} = $_ } @handles; | ||
| 21 | } | ||
| 22 | else { | ||
| 23 | $options->{handles} = \@handles; | ||
| 24 | } | ||
| 25 | |||
| 26 | }; | ||
| 27 | |||
| 28 | |||
| 29 | package Moose::Meta::Attribute::Custom::Trait::GappDefault; | ||
| 30 | { | ||
| 31 | $Moose::Meta::Attribute::Custom::Trait::GappDefault::VERSION = '0.60'; | ||
| 32 | } | ||
| 33 | sub register_implementation { 'Gapp::Meta::Attribute::Trait::GappDefault' }; | ||
| 34 | |||
| 35 | 1; |