projects
/
Biblio-Isis
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
to_hash now accept parametars
[Biblio-Isis]
/
lib
/
Biblio
/
Isis.pm
diff --git
a/lib/Biblio/Isis.pm
b/lib/Biblio/Isis.pm
index
b11e856
..
a87994f
100644
(file)
--- a/
lib/Biblio/Isis.pm
+++ b/
lib/Biblio/Isis.pm
@@
-491,12
+491,26
@@
following structure:
This method will also create additional field C<000> with MFN.
This method will also create additional field C<000> with MFN.
+There is also more elaborative way to call C<to_hash> like this:
+
+ my $hash = $isis->to_hash({
+ mfn => 42,
+ include_empty_subfields => 1,
+ });
+
=cut
sub to_hash {
my $self = shift;
=cut
sub to_hash {
my $self = shift;
+
my $mfn = shift || confess "need mfn!";
my $mfn = shift || confess "need mfn!";
+ my $arg;
+
+ if (ref($mfn) eq 'HASH') {
+ $arg = $mfn;
+ $mfn = $arg->{mfn} || confess "need mfn in arguments";
+ }
# init record to include MFN as field 000
my $rec = { '000' => [ $mfn ] };
# init record to include MFN as field 000
my $rec = { '000' => [ $mfn ] };
@@
-662,7
+676,8
@@
You can find version dependencies documented here
=item 0.20
=item 0.20
-Added C<< $isis->mfn >> and support for repeatable subfields
+Added C<< $isis->mfn >>, support for repeatable subfields and
+C<< $isis->to_hash({ mfn => 42, ... }) >> calling convention
=back
=back