Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#chunked_values_at(keys, max = 5000) ⇒ Object



111
112
113
114
115
116
117
# File 'lib/rbbt/util/misc/objects.rb', line 111

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

#marshal_load(array) ⇒ Object



371
372
373
374
375
# File 'lib/rbbt/tsv/util.rb', line 371

def marshal_load(array)
  info, to_hash = array
  self.merge! to_hash
  TSV.setup(self)
end