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