TV::Anytime::Group - Represent a program group


TV-Anytime documentation Contained in the TV-Anytime distribution.

Index


Code Index:

NAME

Top

TV::Anytime::Group - Represent a program group

SYNOPSIS

Top

  print "    ID: " . $group->id . "\n";
  print " Title: " . $group->title . "\n";
  print "Series: " . $group->is_series . "\n";
  print "        $_\n" foreach $group->members;
  print "    isa $_\n" foreach $group->parents;

DESCRIPTION

Top

The TV::Anytime::Group represents a program group, such as categorisation of programs or a series.

METHODS

Top

head2 id

This returns the ID of the group:

  print "    ID: " . $group->id . "\n";

members

This returns a list of the member IDs of the group:

  print "        $_\n" foreach $group->members;

parents

This returns a list of the parent IDs of the group:

  print "    isa $_\n" foreach $group->parents;

title

This returns the title of the group:

  print " Title: " . $group->title . "\n";

is_series

This returns whether the group is a series (or instead a group of groups):

  print "Series: " . $group->is_series . "\n";

SEE ALSO

Top

TV::Anytime

BUGS

Top

Please report any bugs or feature requests to bug-TV-Anytime@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Top

Leon Brocard acme@astray.com

LICENCE AND COPYRIGHT

Top


TV-Anytime documentation Contained in the TV-Anytime distribution.

package TV::Anytime::Group;
use strict;
use warnings;
use base 'Class::Accessor::Chained::Fast';
__PACKAGE__->mk_accessors(qw(id type title members_ref parents_ref));

sub members {
  my $self = shift;
  return @{$self->members_ref || []};
}

sub parents {
  my $self = shift;
  return @{$self->parents_ref || []};
}

sub is_series {
  my $self = shift;
  return $self->type eq 'series' ? 1 : 0;
}

1;

__END__