NAME

Form::Factory::Control::Role::BooleanValue - boolean valued controls

VERSION

version 0.009

DESCRIPTION

Controls that implement this role have a boolean value. This say much about how that is actually implemented, just that is has a "true_value" a "false_value" and then a flag stating whether the true value or false value is currently selected.

ATTRIBUTES

true_value

The string value the control should have when the control "is_true".

false_value

The string value the control should have when the control is not "is_true".

METHODS

is_true

Returns a true value when the current_value is set to "true_value" or a false value when the current_value is set to "false_value".

This method returns undef if it is neither true nor false.

If passed a value:

  $self->is_true(1);

This will set the value attribute. If a true value is given, the value will be set to "true_value". Otherwise, it will cause value to take on the contents of "false_value".

AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2009 Qubling Software LLC.

This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.