Masatoshi Mizuno > Egg-Release > Egg::Base

Download:
Egg-Release-3.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

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

NAME ^

Egg::Base - Generic base class for Egg.

SYNOPSIS ^

  package Hoge;
  use base qw/Egg::Base/;

DESCRIPTION ^

It is a general base class for Egg.

I think it is convenient when using it by the handler etc. of the plugin.

METHODS ^

mk_accessors ([CREATE_METHODS])

Class::Accessor The thing considerably is done.

  __PACKAGE__->mk_accessors(qw/ hoge boo /);

new ([EGG_CONTEXT], [PARAM_HASH_REF])

General constructor for Egg application.

The object of the project is always necessary for EGG_CONTEXT.

Parameters is set at the same time as giving PARAM_HASH_REF.

   my $app= Hoge->new($e, { zoo=> 1 });

e

It is an accessor to the project object.

  $app->e;

parameters

It is an accessor to the parameter. It is the one that relates to PARAM_HASH_REF passed to the constructor.

  my $param= $app->parameters;
  print $param->{zoo};

param ([KEY], [VALUE])

When the argument is omitted, the list of the key registered in parameters is returned.

When KEY is given, the value of parameters->{KEY} is returned.

When VALUE is given, the value is set in parameters->{KEY}.

  my @key_list= $app->param;
  
  print $app->param('zoo');
  
  $app->param('boo' => 'abc');

config ([CONFIG])

The method of the relation to the class of '_config' is generated when CONFIG is given, and CONFIG is set in the method.

When CONFIG is omitted, the content of the method of '_config' is returned.

  $class->config({
    ...........
    .....
    });

config_to ([NAME_LIST])

The content of 'Config' of the class that generates it with the project name and NAME_LIST is returned.

  # MyApp::Model::ComponentName->config is acquired.
  my $config= $app->config_to(qw/ Model ComponentName /);

error ([MESSAGE])

MESSAGE is set in errstr.

This method always returns 0.

Even if ARRAY is given to MESSAGE, it is treatable well.

   $app->error('Internal Error');

errstr

For reference to value set with error. The value cannot be set.

If the receiver of the value has received it with ARRAY, the list is returned. The character string of ',' delimitation is returned if it receives it with SCALAR.

  my @error_list= $hoge->errstr;
  
  my $error_string= $hoge->errstr;

SEE ALSO ^

Egg::Release, Class::Data::Inheritable,

AUTHOR ^

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: