Method: Xcodeproj::Workspace#initialize

Defined in:
lib/xcodeproj/workspace.rb

#initialize(document, *file_references) ⇒ Workspace

Note:

The document parameter is passed to the << operator if it is not a valid REXML::Document. It is optional, but may also be passed as nil

Returns a new instance of Workspace.

Parameters:

  • document (REXML::Document)

    @see document

  • file_references (Array<FileReference>)

    additional projects to add



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/xcodeproj/workspace.rb', line 43

def initialize(document, *file_references)
  @schemes = {}
  if document.nil?
    @document = REXML::Document.new(root_xml(''))
  elsif document.is_a?(REXML::Document)
    @document = document
  else
    @document = REXML::Document.new(root_xml(''))
    self << document
  end
  file_references.each { |ref| self << ref }
end