package Archive::Rgssad::Entry;

use 5.010;
use strict;
use warnings FATAL => 'all';

=head1 NAME

Archive::Rgssad::Entry - A (path, data) pair in rgssad archive.


our $VERSION = '0.1';


    use Archive::Rgssad::Entry;

    # create a new entry
    my $entry = Archive::Rgssad::Entry->new($path, $data);

    # update path and data

    # save the entry to file
    open FH, '>', $entry->path;
    print FH $entry->data;
    close FH;


Each entry in rgssad archive is simply a (path, data) pair.

=head2 Constructor

=over 4

=item new([$path [, $data]])

Create a new entry.



sub new {
  my $class = shift;
  my $self = {
    path => $_[0] // '',
    data => $_[1] // ''
  bless $self, $class;
  return $self;

=head2 Accessors

=over 4

=item path([$new_path])

Return the path of the entry. If $new_path is given, set the path to $new_path and return it.


sub path {
  my $self = shift;
  $self->{path} = shift if @_;
  return $self->{path};

=item data([$new_data])

Return the data of the entry. If $new_data is given, set the data to $new_data and return it.


sub data {
  my $self = shift;
  $self->{data} = shift if @_;
  return $self->{data};


=head1 AUTHOR

Zejun Wu, C<< <watashi at> >>

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Archive::Rgssad::Entry

You can also look for information at:

=over 4

=item * GitHub




Copyright 2012 Zejun Wu.

This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.

See L<> for more information.


1; # End of Archive::Rgssad::Entry