aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/UI/ViewPort/Field/Mutable/Boolean.pm
blob: e72561505e8cd00e60d718a5bd11c4208cd78c74 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package Reaction::UI::ViewPort::Field::Mutable::Boolean;

use Reaction::Class;

use namespace::clean -except => [ qw(meta) ];
extends 'Reaction::UI::ViewPort::Field::Boolean';

with 'Reaction::UI::ViewPort::Field::Role::Mutable::Simple';
sub adopt_value_string {
  my ($self) = @_;
  $self->value($self->value_string||0);
};
sub BUILD {
  my($self) = @_;
  $self->value(0) unless $self->_model_has_value;
};

__PACKAGE__->meta->make_immutable;


1;