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

Download:
Form-Factory-0.020.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.020   Source  

NAME ^

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

VERSION ^

version 0.020

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 ^

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.

syntax highlighting: