Andrew Sterling Hanenkamp > Form-Factory > Form::Factory::Message

Download:
Form-Factory-0.022.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.022   Source  

NAME ^

Form::Factory::Message - Handy class for encapsulating messages

VERSION ^

version 0.022

SYNOPSIS ^

  my $message = Form::Factory::Message->new(
      field   => 'foo',
      type    => 'warning',
      message => 'Blah blah blah',
  );

  if ($message->type eq 'warning' or $message->type eq 'error') {
      print uc($message->type);
  }

  if ($message->is_tied_to_field) {
      print $message->field, ": ", $message->message, "\n";
  }

DESCRIPTION ^

This is used to store messages that describe the outcome of the various parts of the action workflow.

ATTRIBUTES ^

field

This is the name of the field the message belongs with. If set the is_tied_to_field predicate will return true.

message

This is the message itself. By convention, the message is expected to be formatted with the initial caps left off and no ending punctuation. This allows it to be more easily formatted or embedded into larger error messages, if necessary.

type

This is the type of message. Must be one of: info, warning, or error.

METHODS ^

english_message

This capitalizes the first character of the message and adds a period at the end of the last character is a word or space character.

AUTHOR ^

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2015 by Qubling Software LLC.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: