summaryrefslogtreecommitdiff
path: root/lib/Net/Riak/Bucket.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-06-14 17:53:00 +0200
committerfranck cuny <franck@lumberjaph.net>2010-06-14 17:54:23 +0200
commitce47f3bb5e8c69a59b678c8ff8956d8a368bcb32 (patch)
treee1542c99df3edd44e9434f244318ff2d871df633 /lib/Net/Riak/Bucket.pm
parentis_alive moved to client (diff)
downloadnet-riak-ce47f3bb5e8c69a59b678c8ff8956d8a368bcb32.tar.gz
add mx::role::parameterized for replicas, bucket and client
Diffstat (limited to 'lib/Net/Riak/Bucket.pm')
-rw-r--r--lib/Net/Riak/Bucket.pm27
1 files changed, 4 insertions, 23 deletions
diff --git a/lib/Net/Riak/Bucket.pm b/lib/Net/Riak/Bucket.pm
index 6c848f9..525fc39 100644
--- a/lib/Net/Riak/Bucket.pm
+++ b/lib/Net/Riak/Bucket.pm
@@ -6,39 +6,20 @@ use JSON;
use Moose;
use Net::Riak::Object;
+with 'Net::Riak::Role::Replica' => {keys => [qw/r w dw/]};
+with 'Net::Riak::Role::Base' =>
+ {classes => [{name => 'client', required => 1}]};
+
has name => (
is => 'ro',
isa => 'Str',
required => 1
);
-has client => (
- is => 'ro',
- isa => 'Net::Riak::Client',
- required => 1
-);
has content_type => (
is => 'rw',
isa => 'Str',
default => 'application/json'
);
-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 }
-);
sub n_val {
my $self = shift;