Method: CFPropertyList228::List#initialize

Defined in:
lib/nixenvironment/CFPropertyList228/lib/cfpropertylist/rbCFPropertyList.rb

#initialize(opts = {}) ⇒ List

initialize a new CFPropertyList228, arguments are:

:file

Parse a file

:format

Format is one of FORMAT_BINARY or FORMAT_XML. Defaults to FORMAT_AUTO

:data

Parse a string

All arguments are optional



242
243
244
245
246
247
248
249
250
# File 'lib/nixenvironment/CFPropertyList228/lib/cfpropertylist/rbCFPropertyList.rb', line 242

def initialize(opts={})
  @filename = opts[:file]
  @format = opts[:format] || FORMAT_AUTO
  @data = opts[:data]
  @formatted = opts[:formatted]

  load(@filename) unless @filename.nil?
  load_str(@data) unless @data.nil?
end