Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/corefoundation/extensions.rb

Overview

Ruby Hash class

Instance Method Summary collapse

Instance Method Details

#to_cfCF::Dictionary

Converts the Hash to an mutable CF::Dictionary by calling ‘to_cf` on each key and value it contains

Returns:



151
152
153
154
155
156
157
# File 'lib/corefoundation/extensions.rb', line 151

def to_cf
  CF::Dictionary.mutable.tap do |r|
    each do |k,v|
      r[k.to_cf] = v.to_cf
    end
  end
end