XML::Atom::Ext::Media::Group - Represents <media:grouå> elements


XML-Atom-Ext-Media documentation Contained in the XML-Atom-Ext-Media distribution.

Index


Code Index:

NAME

Top

XML::Atom::Ext::Media::Group - Represents <media:grouÄ> elements

VERSION

Top

version 0.092840

SEE ALSO

Top

* XML::Atom::Ext::Media::Base

ATTRIBUTES

Top

content

Returns the first XML::Atom::Ext::Media::Content object in SCALAR context, or a list of them in LIST context.

contents

Returns a ARRAYREF in SCALAR context and otherwise behaves like content

METHODS

Top

default_content

Will look through contents for any element that returns true for isDefault. If no such element is found, it will return the first element in contents

AUTHOR

Top

  Andreas Marienborg <andremar@cpan.org>

COPYRIGHT AND LICENSE

Top


XML-Atom-Ext-Media documentation Contained in the XML-Atom-Ext-Media distribution.

package XML::Atom::Ext::Media::Group;
our $VERSION = '0.092840';


#ABSTRACT: Represents <media:grouå> elements

use strict;
use warnings;

use base qw( XML::Atom::Ext::Media::Base );


__PACKAGE__->mk_object_list_accessor(
    content => 'XML::Atom::Ext::Media::Content', 'contents' 
);


sub default_content {
    my ($self) = @_;
    
    my @contents = $self->contents;
    foreach (@contents) {
        return $_ if $_->isDefault;
    }
    # Fallback to the first one
    return $contents[0];
}
sub element_name {
    return 'group';
}

1;


__END__