Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/rbbt/util/misc.rb

Instance Method Summary collapse

Instance Method Details

#chunked_values_at(keys, max = 5000) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/rbbt/util/misc.rb', line 7

def chunked_values_at(keys, max = 5000)
  Misc.ordered_divide(keys, max).inject([]) do |acc,c|
    new = self.values_at(*c)
    new.annotate acc if new.respond_to? :annotate and acc.empty?
    acc.concat(new)
  end
end