lib/picky/internals/results/base.rb in picky-1.5.2 vs lib/picky/internals/results/base.rb in picky-1.5.3
- old
+ new
@@ -13,23 +13,23 @@
attr_reader :allocations, :offset
# Takes instances of Query::Allocations as param.
#
def initialize offset = 0, allocations = Query::Allocations.new
- @offset = offset
- @allocations = allocations # || Query::Allocations.new
+ @offset = offset
+ @allocations = allocations
end
# Create new results and calculate the ids.
#
def self.from offset, allocations
results = new offset, allocations
results.prepare!
results
end
+ # Returns a hash with the allocations, offset, duration and total.
#
- #
def serialize
{ allocations: allocations.to_result,
offset: offset,
duration: duration,
total: total }
@@ -82,16 +82,9 @@
# Delegates to allocations.
#
def ids amount = 20
allocations.ids amount
- end
- # Gets an amout of random ids from the allocations.
- #
- # Note: Basically delegates to the allocations.
- #
- def random_ids amount = 1
- allocations.random_ids amount
end
# Human readable log.
#
def to_log query
\ No newline at end of file