diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-05-10 21:55:33 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-05-10 21:55:33 +0200 |
| commit | b5f8ecf61b083da72a6f56f89099fc098ffc2d7f (patch) | |
| tree | d681ec789320bb84ed97294fa3b4c1237548867a /lib/AnyEvent/Riak/Object.pm | |
| parent | use moose, keep compatibility with old interface (diff) | |
| download | anyevent-riak-b5f8ecf61b083da72a6f56f89099fc098ffc2d7f.tar.gz | |
class for bucket and object
Diffstat (limited to 'lib/AnyEvent/Riak/Object.pm')
| -rw-r--r-- | lib/AnyEvent/Riak/Object.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/AnyEvent/Riak/Object.pm b/lib/AnyEvent/Riak/Object.pm new file mode 100644 index 0000000..f756af4 --- /dev/null +++ b/lib/AnyEvent/Riak/Object.pm @@ -0,0 +1,20 @@ +package AnyEvent::Riak::Object; + +use Moose; + +has _client => (is => 'rw', isa => 'AnyEvent::Riak', requid => 1); +has key => (is => 'rw', isa => 'Str'); +has content => (is => 'rw', isa => 'HashRef'); +has content_type => (is => 'rw', isa => 'Str', default => 'application/json'); +has bucket => (is => 'rw', isa => 'AnyEvent::Riak::Bucket', required => 1); +has status => (is => 'rw', isa => 'Int'); +has r => (is => 'rw', isa => 'Int'); + +sub get { + my ($self) = @_; + $self->_client->http_get($self->bucket_name, $self->key, $self->r); +} + +no Moose; + +1; |
