package Yahoo::Photos::Album;
use 5.008;
use utf8;
use strict;
use warnings;
use Class::Spiffy qw(-base field);
use Perl::Version qw(); our $VERSION = Perl::Version->new('0.0.2')->stringify;

my @field_names = qw(id name url upload_url);
for my $field_name (@field_names) {
    field $field_name;

sub _new {
    my $class = shift;
    my $self = {};
    bless $self, $class;

    my %p = @_;
    foreach my $field_name (@field_names) {
        if (exists $p{$field_name}) {

    return $self;

sub _merge {
    my $self = shift;
    my $album = shift;

    foreach my $field_name (@field_names) {
        if (!$self->$field_name) {

    return $self;



=head1 NAME

Yahoo::Photos::Album - Yahoo Photos album class

=head1 VERSION

This document describes Yahoo::Photos::Album version 0.0.2


    print $album->id;
    print $album->name;


This module represents an album on Yahoo Photos.



=item id

Returns the id associated with this album.
It is a short alphanumeric string like I<9ad5re2>.

=item name

Returns the name associated with this album.


=encoding utf8