Class: CFPropertyList::CFDictionary
Overview
this class contains a hash of values
Instance Attribute Summary
Attributes inherited from CFType
Instance Method Summary collapse
-
#initialize(value = {}) ⇒ CFDictionary
constructor
Create new CFDictonary type.
-
#to_binary(bplist) ⇒ Object
convert to binary.
-
#to_xml ⇒ Object
convert to XML.
Constructor Details
#initialize(value = {}) ⇒ CFDictionary
Create new CFDictonary type.
209 210 211 |
# File 'lib/rbCFTypes.rb', line 209 def initialize(value={}) @value = value end |
Instance Method Details
#to_binary(bplist) ⇒ Object
convert to binary
227 228 229 |
# File 'lib/rbCFTypes.rb', line 227 def to_binary(bplist) return bplist.dict_to_binary(self) end |
#to_xml ⇒ Object
convert to XML
214 215 216 217 218 219 220 221 222 223 224 |
# File 'lib/rbCFTypes.rb', line 214 def to_xml n = LibXML::XML::Node.new('dict') @value.each_pair do |key,value| k = LibXML::XML::Node.new('key') << LibXML::XML::Node.new_text(key) n << k n << value.to_xml end return n end |