lib/sixarm_ruby_ramp/pairable.rb
# Call block once for each key-value pair in self,
# passing the key and value as parameters to the block.
# and mapping these to a result.
#
# @example
#   h = {"a" => "b"}
#   h.map_pair{|key, value| key.upcase, value.upcase }
#   => {"A" => "B"}
#
# @return [self.class] a new object with the mapped keys and mapped values.
#
Call block once for each key-value pair in self,
passing the key and value as parameters to the block.
and mapping these to a result.
Call block once for each key - value pair in self passing the key and value as parameters to the block . and mapping these to a result .
def map_pair
    result = self.class.new
    keys.each{|key| k, v = yield key, self[key]; result[k] = v}
    result
  end
def map_pair result = self . class . new keys . each { | key | k , v = yield key , self [ key ] ; result [ k ] = v } result end
Call block once for each key-value pair in self,
passing the key and value as parameters to the block.
Call block once for each key - value pair in self passing the key and value as parameters to the block .
a new object with the mapped keys and mapped values.
a new object with the mapped keys and mapped values .
self.class
example
None