From 8680309d434d848f77ac30d132f1fbca7f9f1230 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Fri, 3 Jun 2011 14:47:02 +0200 Subject: attributes are chained Signed-off-by: franck cuny --- lib/Graph/GEXF/Node.pm | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) (limited to 'lib/Graph/GEXF') diff --git a/lib/Graph/GEXF/Node.pm b/lib/Graph/GEXF/Node.pm index 0d691b7..8f8187a 100644 --- a/lib/Graph/GEXF/Node.pm +++ b/lib/Graph/GEXF/Node.pm @@ -9,8 +9,18 @@ with 'Graph::GEXF::Role::Viz::Size' => { as => 'size' }, 'Graph::GEXF::Role::Viz::Shape' => { for => 'node' }; -has id => (is => 'ro', isa => 'Str', required => 1); -has label => (is => 'rw', isa => 'Str'); +has id => ( + is => 'ro', + isa => 'Str', + required => 1, + traits => ['Chained'] +); + +has label => ( + is => 'rw', + isa => 'Str', + traits => ['Chained'] +); has edges => ( traits => ['Hash'], @@ -71,7 +81,7 @@ no Moose; my $graph = Graph::GEXF->new(); - my $n = $graph->add_node; + my $n = $graph->add_node(); =head1 DESCRIPTION @@ -91,6 +101,32 @@ The B of a node can't be changed once the node is created. Each node has a label. If the B