+=head2 to_hash
+
+ $self->to_hash( $tag );
+
+=cut
+
+sub to_hash {
+ my ( $self, $tag ) = @_;
+ 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;
+ my $hash = $decode->to_hash( $self->blocks( $tag ) );
+ $hash->{tag_type} = $type;
+ return $hash;
+}
+
+