~ubuntu-branches/ubuntu/quantal/libnet-openid-common-perl/quantal

« back to all changes in this revision

Viewing changes to lib/Net/OpenID/Yadis/Service.pm

  • Committer: Package Import Robot
  • Author(s): Dominic Hargreaves
  • Date: 2011-11-11 22:07:41 UTC
  • Revision ID: package-import@ubuntu.com-20111111220741-duf8dtmvkh2jiiwm
Tags: upstream-1.14
ImportĀ upstreamĀ versionĀ 1.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
package Net::OpenID::Yadis::Service;
 
3
BEGIN {
 
4
  $Net::OpenID::Yadis::Service::VERSION = '1.14';
 
5
}
 
6
 
 
7
use strict;
 
8
use warnings;
 
9
 
 
10
sub URI { Net::OpenID::Yadis::_pack_array(shift->{'URI'}) }
 
11
sub Type { Net::OpenID::Yadis::_pack_array(shift->{'Type'}) }
 
12
sub priority { shift->{'priority'} }
 
13
 
 
14
sub extra_field {
 
15
    my $self = shift;
 
16
    my ($field,$xmlns) = @_;
 
17
    $xmlns and $field = "\{$xmlns\}$field";
 
18
    $self->{$field};
 
19
}
 
20
 
 
21
1;
 
22
__END__
 
23
 
 
24
=head1 NAME
 
25
 
 
26
Net::OpenID::Yadis::Service - Class representing an XRDS Service element
 
27
 
 
28
=head1 VERSION
 
29
 
 
30
version 1.14
 
31
 
 
32
=head1 SYNOPSIS
 
33
 
 
34
  use Net::OpenID::Yadis;
 
35
  my $disc = Net::OpenID::Yadis->new();
 
36
  my @xrd = $disc->discover("http://id.example.com/") or Carp::croak($disc->err);
 
37
 
 
38
  foreach my $srv (@xrd) {         # Loop for Each Service in Yadis Resourse Descriptor
 
39
    print $srv->priority;          # Service priority (sorted)
 
40
    print $srv->Type;              # Identifier of some version of some service (scalar, array or array ref)
 
41
    print $srv->URI;               # URI that resolves to a resource providing the service (scalar, array or array ref)
 
42
    print $srv->extra_field("Delegate","http://openid.net/xmlns/1.0");
 
43
                                   # Extra field of some service
 
44
  }
 
45
 
 
46
=head1 DESCRIPTION
 
47
 
 
48
After L<Net::OpenID::Yadis> performs discovery, the result is a list
 
49
of instances of this class.
 
50
 
 
51
=head1 METHODS
 
52
 
 
53
=over 4
 
54
 
 
55
=item $srv->B<priority>
 
56
 
 
57
The priority value for the service.
 
58
 
 
59
=item $srv->B<Type>
 
60
 
 
61
The URI representing the kind of service provided at the endpoint for this record.
 
62
 
 
63
=item $srv->B<URI>
 
64
 
 
65
The URI of the service endpoint.
 
66
 
 
67
=item $srv->B<extra_field>( $fieldname , $namespace )
 
68
 
 
69
Fetch the value of extension fields not provided directly by this class.
 
70
 
 
71
If C<$namespace> is not specified, the default is the namespace whose name is the empty string.
 
72
 
 
73
=back
 
74
 
 
75
=head1 COPYRIGHT, WARRANTY, AUTHOR
 
76
 
 
77
See L<Net::OpenID::Yadis> for author, copyright and licensing information.
 
78
 
 
79
=head1 SEE ALSO
 
80
 
 
81
L<Net::OpenID::Yadis>
 
82
 
 
83
Yadis website:  L<http://yadis.org/>
 
 
b'\\ No newline at end of file'