package GO::Object::URL; =head1 NAME GO::Object::URL - represents a GO::Object::URL on any of the various GO pages =cut use strict; use Data::Dumper; use Exporter; #use GO::MiniTests qw/:std/; use lib '/Users/gwg/go/scratch/tools'; use vars qw(@ISA); use base qw(GO::Object::Generic); #GO::MiniTests); use GO::TestSet qw(dfv_test); sub _specification { my $self = shift; return ( # required "href", { test => dfv_test('is_an_url_p'), required => 1, }, "link_title", { test => dfv_test('is_a_string_p'), }, "link_type", { test => dfv_test('is_a_string_p'), }, "link_text", { test => dfv_test('is_a_string_p'), }, "is_external_link", { test => dfv_test('is_true_p'), }, "rel", { test => dfv_test('is_a_string_p'), }, ); } sub link_title { my $self = shift; return $self->{link_title} || $self->{link_text} || $self->{href}; } sub link_text { my $self = shift; return $self->{link_text} || $self->{href}; } 1;