Skip to content

Instantly share code, notes, and snippets.

@perigrin
Created December 24, 2009 18:50
Show Gist options
  • Select an option

  • Save perigrin/263302 to your computer and use it in GitHub Desktop.

Select an option

Save perigrin/263302 to your computer and use it in GitHub Desktop.
my $code = q{
package YP::XML::Atom::Feed;
use Moose;
use namespace::autoclean;
use XML::Toolkit;
has 'author_collection' => (
isa => 'ArrayRef[YP::XML::Atom::Author]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_author => ['push'] },
description => { sort_order => 0, },
);
has 'dc' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "dc",
node_type => "attribute",
Name => "xmlns:dc",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 1,
},
);
has 'description_collection' => (
isa => 'ArrayRef[YP::XML::DC::Description]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_description => ['push'] },
description => { sort_order => 2, },
);
has 'entry_collection' => (
isa => 'ArrayRef[YP::XML::Atom::Entry]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_entry => ['push'] },
description => { sort_order => 3, },
);
has 'foaf' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "foaf",
node_type => "attribute",
Name => "xmlns:foaf",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 4,
},
);
has 'id_collection' => (
isa => 'ArrayRef[YP::XML::Atom::Id]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_id => ['push'] },
description => { sort_order => 5, },
);
has 'image' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "image",
node_type => "attribute",
Name => "xmlns:image",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 6,
},
);
has 'itemsPerPage_collection' => (
isa => 'ArrayRef[YP::XML::OpenSearch::ItemsPerPage]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_itemsPerPage => ['push'] },
description => { sort_order => 7, },
);
has 'link_collection' => (
isa => 'ArrayRef[YP::XML::Atom::Link]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_link => ['push'] },
description => { sort_order => 8, },
);
has 'media' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "media",
node_type => "attribute",
Name => "xmlns:media",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 9,
},
);
has 'openSearch' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "openSearch",
node_type => "attribute",
Name => "xmlns:openSearch",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 10,
},
);
has 'rdf' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "rdf",
node_type => "attribute",
Name => "xmlns:rdf",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 11,
},
);
has 'startIndex_collection' => (
isa => 'ArrayRef[YP::XML::OpenSearch::StartIndex]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_startIndex => ['push'] },
description => { sort_order => 12, },
);
has 'title_collection' => (
isa => 'ArrayRef[YP::XML::Atom::Title]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_title => ['push'] },
description => { sort_order => 13, },
);
has 'totalResults_collection' => (
isa => 'ArrayRef[YP::XML::OpenSearch::TotalResults]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_totalResults => ['push'] },
description => { sort_order => 14, },
);
has 'updated_collection' => (
isa => 'ArrayRef[YP::XML::Atom::Updated]',
is => 'ro',
traits => [qw(XML Native::Array)],
lazy => 1,
auto_deref => 1,
default => sub { [] },
handles => { add_updated => ['push'] },
description => { sort_order => 15, },
);
has 'xmlns' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "",
LocalName => "xmlns",
node_type => "attribute",
Name => "xmlns",
NamespaceURI => "",
sort_order => 16,
},
);
has 'yp' => (
isa => 'Str',
is => 'ro',
traits => ['XML'],
description => {
Prefix => "xmlns",
LocalName => "yp",
node_type => "attribute",
Name => "xmlns:yp",
NamespaceURI => "http://www.w3.org/2000/xmlns/",
sort_order => 17,
},
);
1;
}
eval $code;
diag "\nAttributes\n\n";
diag $_ for YP::XML::Atom::Feed->meta->get_attribute_list;
diag "\nMethods\n\n";
diag $_ for YP::XML::Atom::Feed->meta->get_all_method_names;
# Attributes
#
# xmlns
# title_collection
# link_collection
# author_collection
# media
# id_collection
# openSearch
# dc
# description_collection
# itemsPerPage_collection
# image
# foaf
# totalResults_collection
# yp
# rdf
# entry_collection
# updated_collection
# startIndex_collection
#
# Methods
#
# meta
# dump
# DEMOLISHALL
# does
# new
# BUILDALL
# DESTROY
# BUILDARGS
# DOES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment