1DBIx::Class::Candy::ExpUosretrs(C3o)ntributed Perl DocumDeBnItxa:t:iColnass::Candy::Exports(3)
2
3
4
6 DBIx::Class::Candy::Exports - Create sugar for your favorite ORM,
7 DBIx::Class
8
10 package DBIx::Class::Widget;
11
12 sub create_a_widget { ... }
13
14 # so you don't depend on ::Candy
15 eval {
16 require DBIx::Class::Candy::Exports;
17 DBIx::Class::Candy::Exports->import;
18 export_methods ['create_a_widget'];
19 export_method_aliases {
20 widget => 'create_a_widget'
21 };
22 }
23
24 1;
25
26 The above will make it such that users of your component who use it
27 with DBIx::Class::Candy will have the methods you designate exported
28 into their namespace.
29
31 The whole point of this module is to make sugar a first class citizen
32 in the component world that dominates DBIx::Class. I make enough
33 components and like this sugar idea enough that I want to be able to
34 have both at the same time.
35
37 export_methods
38 export_methods [qw( foo bar baz )];
39
40 Use this subroutine to define methods that get exported as subroutines
41 of the same name.
42
43 export_method_aliases
44 export_method_aliases {
45 old_method_name => 'new_sub_name',
46 };
47
48 Use this subroutine to define methods that get exported as subroutines
49 of a different name.
50
52 Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
53
55 This software is copyright (c) 2017 by Arthur Axel "fREW" Schmidt.
56
57 This is free software; you can redistribute it and/or modify it under
58 the same terms as the Perl 5 programming language system itself.
59
60
61
62perl v5.38.0 2023-07-20 DBIx::Class::Candy::Exports(3)