| 1 | package Devel::IPerl::Plugin::Display; | ||
| 2 | $Devel::IPerl::Plugin::Display::VERSION = '0.012'; | ||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | |||
| 7 | sub register { | ||
| 8 | my ($self, $iperl) = @_; | ||
| 9 | # TODO generalise the plugin registration | ||
| 10 | for my $name (qw(display)) { | ||
| 11 | $iperl->helper( $name => sub { shift; $self->$name(@_) } ); | ||
| 12 | } | ||
| 13 | } | ||
| 14 | |||
| 15 | sub display { | ||
| 16 | my $self = shift; | ||
| 17 | $IPerl::REPL->display_data( @_ ); | ||
| 18 | } | ||
| 19 | |||
| 20 | |||
| 21 | 1; | ||
| 22 | |||
| 23 | __END__ |