Fix role behaviour for bundling docs
Change-Id: I048f984311d344169710b586b1ecc795b0d8d584
diff --git a/lib/Krawfish/Compile/Segment/Bundle.pm b/lib/Krawfish/Compile/Segment/Bundle.pm
index 2fdb0b4..632c37a 100644
--- a/lib/Krawfish/Compile/Segment/Bundle.pm
+++ b/lib/Krawfish/Compile/Segment/Bundle.pm
@@ -8,7 +8,7 @@
next_bundle/;
-# This class represents bundles of postings
+# This role represents bundles of postings
# (or bundles of bundles of postings) sorted by a certain criterion.
@@ -28,16 +28,9 @@
# Get current match
-sub current_match {
- $_[0]->{current_match};
-};
-
-
-# Get next bundle
-# This needs to be overwritten!
-sub next_bundle {
- ...
-};
+#sub current_match {
+# $_[0]->{current_match};
+#};
diff --git a/lib/Krawfish/Compile/Segment/BundleDocs.pm b/lib/Krawfish/Compile/Segment/BundleDocs.pm
index 871d37c..e7b8f18 100644
--- a/lib/Krawfish/Compile/Segment/BundleDocs.pm
+++ b/lib/Krawfish/Compile/Segment/BundleDocs.pm
@@ -6,6 +6,7 @@
use Role::Tiny;
with 'Krawfish::Compile::Segment::Bundle';
+with 'Krawfish::Compile';
requires qw/next_bundle/;
@@ -16,6 +17,7 @@
# The problem with the current approch is, that next_bundle
# will bundle the next doc - without asking if the doc
# is relevant.
+# That's why next_doc is identical to next_bundle-
use constant DEBUG => 0;
@@ -37,10 +39,9 @@
};
-# TODO:
-# Implement next doc!
+# Move to next doc
sub next_doc {
- ...
+ return $_[0]->next_bundle;
};