GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOUSE::EXPORTER (3)

.ds Aq ’

NAME

Mouse::Exporter - make an import() and unimport() just like Mouse.pm

CONTENTS

VERSION

This document describes Mouse version v2.4.5

SYNOPSIS



    package MyApp::Mouse;

    use Mouse ();
    use Mouse::Exporter;

    Mouse::Exporter->setup_import_methods(
      as_is => [ has_rw, other_sugar, \&Some::Random::thing ],
      also  => Mouse,
    );

    sub has_rw {
        my $meta = caller->meta;
        my ( $name, %options ) = @_;
        $meta->add_attribute(
          $name,
          is => rw,
          %options,
        );
    }

    # then later ...
    package MyApp::User;

    use MyApp::Mouse;

    has name;
    has_rw size;
    thing;

    no MyApp::Mouse;



DESCRIPTION

This module encapsulates the exporting of sugar functions in a Mouse.pm-like manner. It does this by building custom import, unimport methods for your module, based on a spec you provide.

Note that Mouse::Exporter does not provide the with_meta option, but you can easily get the metaclass by caller->meta as SYNOPSIS shows.

METHODS

CWsetup_import_methods( ARGS )

CWbuild_import_methods( ARGS ) -> (\&import, \&unimport)

SEE ALSO

Moose::Exporter
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOUSE::EXPORTER (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.