Skip to content

Commit

Permalink
Split method to generate slice instances
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Dec 5, 2014
1 parent 961a616 commit f3d0e6d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/droonga/catalog/slices.rb
Expand Up @@ -39,9 +39,7 @@ def slicer

def slices
return nil unless @data.key?("slices")
@slices ||= @data["slices"].collect do |raw_slice|
Slice.new(@dataset, raw_slice)
end
@slices ||= create_slices
end

def select_slices(range=0..-1)
Expand Down Expand Up @@ -109,6 +107,12 @@ def stringify_key(key)
end
end

def create_slices
@data["slices"].collect do |raw_slice|
Slice.new(@dataset, raw_slice)
end
end

def collect_all_nodes
nodes = []
slices.each do |slice|
Expand Down

0 comments on commit f3d0e6d

Please sign in to comment.