Class: CFPropertyList228::CFArray

Inherits:
CFType
  • Object
show all
Defined in:
lib/nixenvironment/CFPropertyList228/lib/cfpropertylist/rbCFTypes.rb

Overview

This class contains an array of values

Instance Attribute Summary

Attributes inherited from CFType

#value

Instance Method Summary collapse

Constructor Details

#initialize(val = []) ⇒ CFArray

create a new array CFType



211
212
213
# File 'lib/nixenvironment/CFPropertyList228/lib/cfpropertylist/rbCFTypes.rb', line 211

def initialize(val=[])
  @value = val
end

Instance Method Details

#to_binary(bplist) ⇒ Object

convert to binary



225
226
227
# File 'lib/nixenvironment/CFPropertyList228/lib/cfpropertylist/rbCFTypes.rb', line 225

def to_binary(bplist)
  bplist.array_to_binary(self)
end

#to_xml(parser) ⇒ Object

convert to XML



216
217
218
219
220
221
222
# File 'lib/nixenvironment/CFPropertyList228/lib/cfpropertylist/rbCFTypes.rb', line 216

def to_xml(parser)
  n = parser.new_node('array')
  @value.each do |v|
    n = parser.append_node(n, v.to_xml(parser))
  end
  n
end