lib/picky/internals/query/combinations/base.rb in picky-2.0.0.pre2 vs lib/picky/internals/query/combinations/base.rb in picky-2.0.0.pre3
- old
+ new
@@ -6,15 +6,15 @@
#
# They are the core of an allocation.
# An allocation consists of a number of combinations.
#
module Combinations # :nodoc:all
-
+
# Base Combinations contain methods for calculating score and ids.
#
class Base
-
+
attr_reader :combinations
delegate :empty?, :to => :@combinations
def initialize combinations = []
@@ -34,17 +34,11 @@
@combinations.sum &:weight
end
def weighted_score weights
weights.score @combinations
end
-
- # Wrap the combinations into an allocation with the result_identifier.
- #
- def pack_into_allocation result_identifier
- Allocation.new self, result_identifier
- end
-
+
# Filters the tokens and identifiers such that only identifiers
# that are passed in, remain, including their tokens.
#
# Note: This method is not totally independent of the calculate_ids one.
# Since identifiers are only nullified, we need to not include the
@@ -68,13 +62,13 @@
#
#
def to_result
@combinations.map &:to_result
end
-
+
end
end
end
-
+
end
\ No newline at end of file