| 1 | package Neo4j::Role::REST; | ||
| 2 | |||
| 3 | use Moose::Role; | ||
| 4 | |||
| 5 | requires 'client', '_self_endpoint'; | ||
| 6 | |||
| 7 | has '_endpoints' => ( | ||
| 8 | isa => 'HashRef', | ||
| 9 | is => 'rw', | ||
| 10 | lazy => 1, | ||
| 11 | traits => ['Hash'], | ||
| 12 | handles => { endpoint => 'get' }, | ||
| 13 | required => 0, | ||
| 14 | builder => '_build_endpoints', | ||
| 15 | ); | ||
| 16 | |||
| 17 | sub _build_endpoints { | ||
| 18 | my $self = shift; | ||
| 19 | # TODO should decode the content | ||
| 20 | # $self->_endpoints(decode_json($self->client->GET($self->_self_endpoint))); | ||
| 21 | } | ||
| 22 | |||
| 23 | 1; |