OpenInteract2::Config::Initializer

OpenInteract2::Config::Initializer is a Perl module for observable configuration initialization events.
Download

OpenInteract2::Config::Initializer Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Chris Winters
  • Publisher web site:
  • http://search.cpan.org/~cwinters/SPOPS-0.87/SPOPS/SQLInterface.pm

OpenInteract2::Config::Initializer Tags


OpenInteract2::Config::Initializer Description

OpenInteract2::Config::Initializer is a Perl module for observable configuration initialization events. OpenInteract2::Config::Initializer is a Perl module for observable configuration initialization events.SYNOPSIS # Add an initializer in your package.conf name mypackage version 1.10 ... config_watcher OpenInteract2::MyInitializerSpops config_watcher OpenInteract2::MyInitializerAction # And the code in our package -- we'll dynamically add a rule from # 'My::Googlable' to a class where 'is_googlable' is set to 'yes' package OpenInteract2::MyInitializerSpops; use strict; sub update { my ( $class, $type, $config ) = @_; return unless ( $type eq 'spops' ); if ( $config->{is_googlable} eq 'yes' ) { push @{ $config->{rules_from} }, 'My::Googable'; } } # Add a configuration observer in the server configuration class = OpenInteract2::MyInitializerAction # and in the class we'll dynamically add a filter to an action where # 'is_googlable' is 'yes' package OpenInteract2::MyInitializerAction; use strict; use OpenInteract2::Context qw( CTX ); sub update { my ( $class, $type, $config ) = @_; return unless ( $type eq 'action' ); if ( 'yes' eq lc $config->{is_googlable} ) { CTX->map_observer( google => $config->{class} ); } } Requirements: · Perl


OpenInteract2::Config::Initializer Related Software