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
DBIx::Class::Candy::Exports(3) User Contributed Perl Documentation DBIx::Class::Candy::Exports(3)

DBIx::Class::Candy::Exports - Create sugar for your favorite ORM, DBIx::Class

 package DBIx::Class::Widget;

 sub create_a_widget { ... }

 # so you don't depend on ::Candy
 eval {
   require DBIx::Class::Candy::Exports;
   DBIx::Class::Candy::Exports->import;
   export_methods ['create_a_widget'];
   export_method_aliases {
     widget => 'create_a_widget'
   };
 }

 1;

The above will make it such that users of your component who use it with DBIx::Class::Candy will have the methods you designate exported into their namespace.

The whole point of this module is to make sugar a first class citizen in the component world that dominates DBIx::Class. I make enough components and like this sugar idea enough that I want to be able to have both at the same time.

 export_methods [qw( foo bar baz )];

Use this subroutine to define methods that get exported as subroutines of the same name.

 export_method_aliases {
   old_method_name => 'new_sub_name',
 };

Use this subroutine to define methods that get exported as subroutines of a different name.

Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>

This software is copyright (c) 2017 by Arthur Axel "fREW" Schmidt.

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

2017-07-14 perl v5.32.1

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

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