);
sub add_custom_type_handler {
- my ($class, $type_name, %handlers) = @_;
+ my ($self, $type_name, %handlers) = @_;
(exists $handlers{expand} && exists $handlers{collapse})
|| confess "Custom type handlers need an expand *and* a collapse method";
$TYPES{$type_name} = \%handlers;
}
sub remove_custom_type_handler {
- my ($class, $type_name) = @_;
+ my ($self, $type_name) = @_;
delete $TYPES{$type_name} if exists $TYPES{$type_name};
}
}
sub _inflate_json {
- my ($class, $json) = @_;
+ my ($self, $json) = @_;
eval { require JSON::Any; JSON::Any->import };
confess "Could not load JSON module because : $@" if $@;
}
sub _inflate_yaml {
- my ($class, $yaml) = @_;
+ my ($self, $yaml) = @_;
require Best;
eval { Best->import([[ qw[YAML::Syck YAML] ]]) };