2 DBIx::Class::InflateColumn::IP - Auto-create NetAddr::IP objects from
6 Load this component and declare columns as IP addresses with the
10 __PACKAGE__->load_components(qw/InflateColumn::IP Core/);
11 __PACKAGE__->add_columns(
13 data_type => 'integer',
16 ip_format => 'numeric',
21 __PACKAGE__->load_components(qw/InflateColumn::IP Core/);
22 __PACKAGE__->add_columns(
24 data_type => 'varchar',
32 Then you can treat the specified column as a NetAddr::IP object.
34 print 'IP address: ', $host->ip_address->addr;
35 print 'Address type: ', $host->ip_address->iptype;
41 Gets/sets the address class that the columns should be inflated into.
42 The default class is NetAddr::IP.
47 Gets/sets the name of the method used to deflate the address for the
48 database. This must return a value suitable for "$ip_class-"new(); The
49 default format is "addr", which returns the address in dotted-quad
50 notation. See "Methods" in NetAddr::IP for suitable values.
53 Chains with "register_column" in DBIx::Class::Row, and sets up IP
54 address columns appropriately. This would not normally be called
55 directly by end users.
58 Dagfinn Ilmari Mannsåker, "<ilmari at ilmari.org>"
61 Please report any bugs or feature requests to
62 "bug-dbix-class-inflatecolumn-ip at rt.cpan.org", or through the web
64 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-InflateColumn
65 -IP>. I will be notified, and then you'll automatically be notified of
66 progress on your bug as I make changes.
69 You can find documentation for this module with the perldoc command.
71 perldoc DBIx::Class::InflateColumn::IP
73 You can also look for information at:
75 * AnnoCPAN: Annotated CPAN documentation
76 <http://annocpan.org/dist/DBIx-Class-InflateColumn-IP>
79 <http://cpanratings.perl.org/d/DBIx-Class-InflateColumn-IP>
81 * RT: CPAN's request tracker
82 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-InflateColumn-I
86 <http://search.cpan.org/dist/DBIx-Class-InflateColumn-IP>
89 DBIx::Class, NetAddr::IP
92 Copyright 2007 Dagfinn Ilmari Mannsåker, all rights reserved.
94 This program is free software; you can redistribute it and/or modify it
95 under the same terms as Perl itself.