Skip to content
Browse files

Fixing names

  • Loading branch information...
1 parent 98f6ef7 commit c2ea4c5c6313da93e5be7f28dfc553ef28d5724e @kthakore committed Dec 10, 2011
Showing with 17 additions and 8 deletions.
  1. +5 −5 lib/Roose/Document.pm
  2. +11 −2 lib/Roose/Engine/Base.pm
  3. +1 −1 lib/Roose/Role/Engine.pm
View
10 lib/Roose/Document.pm
@@ -9,7 +9,7 @@ use MooseX::Role::Parameterized;
use Roose::Meta::AttributeTraits;
parameter '-engine' => ( isa => 'Roose::Role::Engine', );
-parameter '-collection_name' => ( isa => 'Str', );
+parameter '-bucket_name' => ( isa => 'Str', );
parameter '-pk' => ( isa => 'ArrayRef[Str]', );
parameter '-as' => ( isa => 'Str', );
@@ -18,7 +18,7 @@ role {
my %args = @_;
my $class_name = $args{consumer}->name;
- my $collection_name = $p->{'-collection_name'} || do {
+ my $bucket_name = $p->{'-bucket_name'} || do {
# sanitize the class name
Roose->naming->("$class_name");
};
@@ -37,17 +37,17 @@ role {
my $config = {
pk => $p->{'-pk'},
as => $p->{'-as'},
- collection_name => $collection_name,
+ bucket_name => $bucket_name,
};
#method "_mxm_config" => sub{ $config };
- $class_name->meta->{mongoose_config} = $config;
+ $class_name->meta->{roose_config} = $config;
# aliasing
if ( my $as = $p->{'-as'} ) {
no strict 'refs';
*{ $as . "::" } = \*{ $class_name . "::" };
- $as->meta->{mongoose_config} = $config;
+ $as->meta->{roose_config} = $config;
}
};
View
13 lib/Roose/Engine/Base.pm
@@ -8,18 +8,27 @@ use Params::Coerce;
use Scalar::Util qw/refaddr reftype/;
use Carp;
use List::Util qw/first/;
+use Data::Dumper;
with 'Roose::Role::Collapser';
with 'Roose::Role::Expander';
with 'Roose::Role::Engine';
-sub save {}
+sub save {
+ my ($self, @scope) = @_;
+ my $b = $self->bucket;
+ }
sub delete {}
sub find {}
sub find_one {}
sub query {}
-sub collection {}
+sub bucket {
+ my ($self, $new_buck) = @_;
+ my $connection = $self->connection;
+
+ warn Dumper $connection;
+ }
sub expand {}
sub collapse {}
View
2 lib/Roose/Role/Engine.pm
@@ -9,7 +9,7 @@ requires 'delete';
requires 'find';
requires 'find_one';
requires 'query';
-requires 'collection';
+requires 'bucket';
=head1 name

0 comments on commit c2ea4c5

Please sign in to comment.
Something went wrong with that request. Please try again.