NAME

Locale::TextDomain::OO::FunctionalInterface - call object methods as funktion

$Id: FunctionalInterface.pm 127 2009-11-29 12:26:47Z steffenw $

$HeadURL: https://perl-gettext-oo.svn.sourceforge.net/svnroot/perl-gettext-oo/trunk/lib/Locale/TextDomain/OO/FunctionalInterface.pm $

VERSION

0.01

DESCRIPTION

This module wraps the object and allows to call a method as function.

SYNOPSIS

use Locale::TextDomain::OO::FunctionalInterface;

or

use Locale::TextDomain::OO::FunctionalInterface qw(bind_object);

SUBROUTINES/METHODS

sub bind_object

$loc = Locale::TextDomain::OO->new(...);

or

$loc = Locale::TextDomain::OO::Maketext->new(...);

and

bind_object($loc); # import all possible methods

or

bind_object($loc, qw(__ __x ...)); # import only the given methods

Translating subs

maketext

print maketext(
    'Hello World!',
);

maketext_p (allows the context)

print maketext_p (
    'time',
    'to',
);

EXAMPLE

Inside of this Distribution is a directory named example. Run this *.pl files.

DIAGNOSTICS

Subroutine bind_object can not bind an undef as method name.

An undefined value is not a method name

Subroutine bind_object only can bind translating subroutines.

Method "..." is not a translation method

Subroutine bind_object can not bind a non existing object method.

Object has no method named "..."

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

Carp

Perl6::Export::Attrs

INCOMPATIBILITIES

not known

BUGS AND LIMITATIONS

none

SEE ALSO

Locale::TextDoamin::OO

Locale::TextDomain::OO::Maketext

AUTHOR

Steffen Winkler

LICENSE AND COPYRIGHT

Copyright (c) 2009, Steffen Winkler <steffenw at cpan.org>. All rights reserved.

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