--- trunk/Estraier.pm 2006/01/04 14:38:35 5 +++ trunk/Estraier.pm 2006/01/04 14:48:11 6 @@ -58,12 +58,16 @@ my $self = {@_}; bless($self, $class); + $self->{id} = -1; + $self ? return $self : return undef; } =head2 add_attr +Add an attribute. + $doc->add_attr( name => 'value' ); B: delete attribute using @@ -84,6 +88,8 @@ =head2 add_text +Add a sentence of text. + $doc->add_text('this is example text to display'); =cut @@ -99,6 +105,8 @@ =head2 add_hidden_text +Add a hidden sentence. + $doc->add_hidden_text('this is example text just for search'); =cut @@ -111,6 +119,19 @@ push @{ $self->{htexts} }, _s($text); } +=head2 id + +Get the ID number of document. If the object has never been registred, C<-1> is returned. + + print $doc->id; + +=cut + +sub id { + my $self = shift; + return $self->{id}; +} + =head2 dump_draft print $doc->dump_draft;