diff options
author | Dave Arter <davea@mysociety.org> | 2017-02-15 17:42:25 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-02-15 17:42:25 +0000 |
commit | 957f2d968c17a34a6fa95bea6cb6a4eace229aa6 (patch) | |
tree | 28ff117ae830534ccd37d3bdc70c8e5dba7f53e9 /perllib/FixMyStreet/Cobrand/Base.pm | |
parent | 54af489f0fe985dfc433f0b8a3ab226a470a6023 (diff) | |
parent | 4d44ea5530a7dc25122e5135c19d89b4cebc5f40 (diff) |
Merge branch 'issues/forcouncils/127-exor-rdi-csv-output'
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Base.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Base.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Base.pm b/perllib/FixMyStreet/Cobrand/Base.pm index a9eed0018..ea2b8f410 100644 --- a/perllib/FixMyStreet/Cobrand/Base.pm +++ b/perllib/FixMyStreet/Cobrand/Base.pm @@ -65,6 +65,18 @@ sub is_default { return $self->moniker eq 'default'; } +=head2 call_hook + + $cobrand->call_hook(foo => 1, 2, 3); # calls $cobrand->foo(1, 2, 3) if it exists + +=cut + +sub call_hook { + my ($self, $method_name, @args) = @_; + my $method = $self->can($method_name) or return; + return $self->$method(@args); +} + # NB: this Base class is for 'meta' features. To add base methods for all cobrands, # you may want to look at FMS::Cobrand::Default instead! |