summaryrefslogtreecommitdiff
path: root/lib/Net/Riak/Role/Replica.pm
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/Net/Riak/Role/Replica.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Net/Riak/Role/Replica.pm b/lib/Net/Riak/Role/Replica.pm
new file mode 100644
index 0000000..d990de2
--- /dev/null
+++ b/lib/Net/Riak/Role/Replica.pm
@@ -0,0 +1,25 @@
+package Net::Riak::Role::Replica;
+
+use MooseX::Role::Parameterized;
+
+parameter keys => (
+ isa => 'ArrayRef',
+ required => 1,
+);
+
+role {
+ my $p = shift;
+
+ my $keys = $p->keys;
+
+ foreach my $k (@$keys) {
+ has $k => (
+ is => 'rw',
+ isa => 'Int',
+ lazy => 1,
+ default => sub { (shift)->client->$k }
+ );
+ }
+};
+
+1;