Method: Msf::DataStore#each

Defined in:
lib/msf/core/data_store.rb

#each(&block) ⇒ Object Also known as: each_pair

Overrides the builtin ‘each’ operator to avoid the following exception on Ruby 1.9.2+

"can't add a new key into hash during iteration"
[View source] [View on GitHub]

398
399
400
401
402
403
404
# File 'lib/msf/core/data_store.rb', line 398

def each(&block)
  list = []
  self.keys.sort.each do |sidx|
    list << [sidx, self[sidx]]
  end
  list.each(&block)
end