Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/pacer/support/hash.rb

Instance Method Summary collapse

Instance Method Details

#to_hash_mapObject



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/pacer/support/hash.rb', line 2

def to_hash_map
  hm = java.util.HashMap.new
  if block_given?
    each do |key, value|
      hm.put(*yield(key, value))
    end
  else
    each do |key, value|
      hm.put key, value
    end
  end
  hm
end