Method: Xqsr3::Containers::MultiMap#each_with_index
- Defined in:
- lib/xqsr3/containers/multi_map.rb
#each_with_index ⇒ Object
Calls block once for each key-values, passing the key and each of its values and a value index
-
Exceptions:
-
ArgumentErrorif no block is given
-
288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/xqsr3/containers/multi_map.rb', line 288 def each_with_index raise ArgumentError, 'block is required' unless block_given? index = 0 self.each do |key, value| yield key, value, index index += 1 end end |