Permalink
Browse files

Updating pop docs with examples of non int ids

  • Loading branch information...
1 parent ab226dd commit ef13376f77e327cecc7a10f0de65b14195e8238a @ironcamel committed Nov 4, 2011
Showing with 6 additions and 6 deletions.
  1. +3 −3 lib/Net/GraphSpace.pm
  2. +3 −3 lib/Net/GraphSpace/Graph.pm
@@ -83,10 +83,10 @@ sub msg_from_res {
server => 'http://foo.com'
);
my $graph = Net::GraphSpace::Graph->new(name => 'yeast ppi');
- my $node1 = Net::GraphSpace::Node->new(id => 1, label => 'A');
- my $node2 = Net::GraphSpace::Node->new(id => 2, label => 'B');
+ my $node1 = Net::GraphSpace::Node->new(id => 'node-a', label => 'A');
+ my $node2 = Net::GraphSpace::Node->new(id => 'node-b', label => 'B');
my $edge = Net::GraphSpace::Edge->new(
- id => '1-2', source => 1, target => 2);
+ id => 'a-b', source => 'node-a', target => 'node-b');
$graph->add_nodes([$node1, $node2]);
$graph->add_edge($edge);
$graph->add_node(Net::GraphSpace::Node->new(id => 3, label => 'C'));
@@ -82,11 +82,11 @@ method new_from_http_response($class: HTTP::Response $res) {
description => 'a great graph',
tags => ['foo', 'bar'],
);
- my $node1 = Net::GraphSpace::Node->new(id => 1, label => 'A');
- my $node2 = Net::GraphSpace::Node->new(id => 2, label => 'B');
+ my $node1 = Net::GraphSpace::Node->new(id => 'node-a', label => 'A');
+ my $node2 = Net::GraphSpace::Node->new(id => 'node-b', label => 'B');
$graph->add_nodes([$node1, $node2]);
my $edge = Net::GraphSpace::Edge->new(
- id => '1-2', source => 1, target => 2);
+ id => 'a-b', source => 'node-a', target => 'node-b');
$graph->add_edge($edge);
$graph->add_node(Net::GraphSpace::Node->new(id => 3, label => 'C'));

0 comments on commit ef13376

Please sign in to comment.