diff options
Diffstat (limited to 'lib/Net/Riak/Object.pm')
-rw-r--r-- | lib/Net/Riak/Object.pm | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/lib/Net/Riak/Object.pm b/lib/Net/Riak/Object.pm index aee4b78..04f40d2 100644 --- a/lib/Net/Riak/Object.pm +++ b/lib/Net/Riak/Object.pm @@ -8,44 +8,20 @@ use Moose; use Scalar::Util; use Net::Riak::Link; +with 'Net::Riak::Role::Replica' => {keys => [qw/r w dw/]}; +with 'Net::Riak::Role::Base' => {classes => + [{name => 'bucket', required => 1}, {name => 'client', required => 1}]}; + has key => ( is => 'rw', isa => 'Str', required => 1 ); -has client => ( - is => 'rw', - isa => 'Net::Riak::Client', - required => 1 -); -has bucket => ( - is => 'rw', - isa => 'Net::Riak::Bucket', - required => 1 -); has data => ( is => 'rw', isa => 'Any', clearer => '_clear_data' ); -has r => ( - is => 'rw', - isa => 'Int', - lazy => 1, - default => sub { (shift)->client->r } -); -has w => ( - is => 'rw', - isa => 'Int', - lazy => 1, - default => sub { (shift)->client->w } -); -has dw => ( - is => 'rw', - isa => 'Int', - lazy => 1, - default => sub { (shift)->client->dw } -); has content_type => ( is => 'rw', isa => 'Str', |