aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/Endpoint.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/Open311/Endpoint.pm')
-rw-r--r--perllib/Open311/Endpoint.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perllib/Open311/Endpoint.pm b/perllib/Open311/Endpoint.pm
index 8a440e4ae..0abb52aab 100644
--- a/perllib/Open311/Endpoint.pm
+++ b/perllib/Open311/Endpoint.pm
@@ -38,7 +38,11 @@ and provide the necessary methods.
=head1 SUBCLASSING
-See also t/open311/endpoint/Endpoint1.pm as an example.
+ package My::Open311::Endpoint;
+ use Web::Simple;
+ extends 'Open311::Endpoint';
+
+See also t/open311/endpoint/Endpoint1.pm and Endpoint2.pm as examples.
=head2 methods to override
@@ -202,6 +206,11 @@ has schema => (
},
);
+sub learn_additional_types {
+ # my ($self, $rx) = @_;
+ ## no-op, but override in ::Role or implementation!
+}
+
has spark => (
is => 'lazy',
default => sub {
@@ -232,6 +241,12 @@ has w3_dt => (
default => sub { DateTime::Format::W3CDTF->new },
);
+sub maybe_inflate_datetime {
+ my ($self, $dt) = @_;
+ return unless $dt;
+ return $self->w3_dt->parse_datetime($dt);
+}
+
=head2 Dispatching
The method dispatch_request returns a list of all the dispatcher routines