Class: Xcodeproj::XCScheme::XMLElementWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/xcodeproj/scheme/xml_element_wrapper.rb

Overview

Abstract base class used for other XCScheme classes wrapping an XML element

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#xml_elementREXML::Element (readonly)

Returns The XML node wrapped and manipulated by this XMLElementWrapper object.

Returns:

  • (REXML::Element)

    The XML node wrapped and manipulated by this XMLElementWrapper object


9
10
11
# File 'lib/xcodeproj/scheme/xml_element_wrapper.rb', line 9

def xml_element
  @xml_element
end

Instance Method Details

#to_sString

Returns The XML representation of the node this XMLElementWrapper wraps, formatted in the same way that Xcode would.

Returns:

  • (String)

    The XML representation of the node this XMLElementWrapper wraps, formatted in the same way that Xcode would.


14
15
16
17
18
19
20
21
22
# File 'lib/xcodeproj/scheme/xml_element_wrapper.rb', line 14

def to_s
  formatter = XMLFormatter.new(2)
  formatter.compact = false
  out = ''
  formatter.write(@xml_element, out)
  out.gsub!("<?xml version='1.0' encoding='UTF-8'?>", '')
  out << "\n"
  out
end