insert tag_type into hash
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Feb 2014 12:33:21 +0000 (13:33 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 6 Feb 2014 12:33:21 +0000 (13:33 +0100)
lib/Biblio/RFID/Reader.pm

index 8a96297..13b8895 100644 (file)
@@ -115,7 +115,9 @@ sub to_hash {
        return unless exists $self->{_tags}->{$tag};
        my $type = $self->{_tags}->{$tag}->{type} || confess "can't find type for tag $tag ",dump( $self->{_tags} );
        my $decode = 'Biblio::RFID::' . $type;
-       return $decode->to_hash( $self->blocks( $tag ) );
+       my $hash = $decode->to_hash( $self->blocks( $tag ) );
+       $hash->{tag_type} = $type;
+       return $hash;
 }