| 1 | package DBIx::Class::Schema::PopulateMore::Inflator; | ||
| 2 | |||
| 3 | 3 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | DBIx::Class::Schema::PopulateMore::Inflator - Base Class for keyword Inflators | ||
| 8 | |||
| 9 | =head1 DESCRIPTION | ||
| 10 | |||
| 11 | When L<DBIx::Class::Schema::PopulateMore::Command> executes, it uses a visitor object | ||
| 12 | (see L<DBIx::Class::Schema::PopulateMore::Visitor> to descend the key values of the | ||
| 13 | data hash that is used to put stuff into the given tables. If it finds a value | ||
| 14 | that matches a particular regexp, that means the value needs to be inflated and | ||
| 15 | it's passed to the inflating dispatcher, which finds the correct Inflator based | ||
| 16 | on the given namespace. | ||
| 17 | |||
| 18 | =head1 ATTRIBUTES | ||
| 19 | |||
| 20 | This class defines the following attributes. | ||
| 21 | |||
| 22 | =head1 METHODS | ||
| 23 | |||
| 24 | This module defines the following methods. | ||
| 25 | |||
| 26 | =head2 name | ||
| 27 | |||
| 28 | returns the name of this inflator. Should be something you expect to be unique | ||
| 29 | across all defined inflators. Defaults to something based on the namespace. | ||
| 30 | |||
| 31 | =cut | ||
| 32 | |||
| 33 | sub name | ||
| 34 | { | ||
| 35 | 20 | ▶ | my $class = ref shift @_; |
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||
| 36 | 20 | my $package = __PACKAGE__; | |
| 37 | 20 | my ($name) = ($class =~m/^$package\:\:(.+)$/); | |
| 38 | |||
| 39 | 20 | return $name; | |
| 40 | } | ||
| 41 | |||
| 42 | |||
| 43 | =head2 inflate($command, $string) | ||
| 44 | |||
| 45 | This is called by L<DBIx::Class::Schema::PopulateMore::Command> dispatcher, when there | ||
| 46 | is a match detected by the visitor. | ||
| 47 | |||
| 48 | =cut | ||
| 49 | |||
| 50 | sub inflate | ||
| 51 | { | ||
| 52 | 0 | ▶ | die "You forgot to implement ->inflate"; |
|
Subroutine
inflate: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 53 | } | ||
| 54 | |||
| 55 | |||
| 56 | =head1 AUTHOR | ||
| 57 | |||
| 58 | Please see L<DBIx::Class::Schema::PopulateMore> For authorship information | ||
| 59 | |||
| 60 | =head1 LICENSE | ||
| 61 | |||
| 62 | Please see L<DBIx::Class::Schema::PopulateMore> For licensing terms. | ||
| 63 | |||
| 64 | =cut | ||
| 65 | |||
| 66 | |||
| 67 | 3 | 1; | |