Class: Xcodeproj::XCScheme::MacroExpansion

Inherits:
XMLElementWrapper show all
Defined in:
lib/xcodeproj/scheme/macro_expansion.rb

Overview

This class wraps the MacroExpansion node of a .xcscheme XML file

Instance Attribute Summary

Attributes inherited from XMLElementWrapper

#xml_element

Instance Method Summary collapse

Methods inherited from XMLElementWrapper

#to_s

Constructor Details

#initialize(target_or_node = nil) ⇒ MacroExpansion

Returns a new instance of MacroExpansion.

Parameters:

  • target_or_node (Xcodeproj::Project::Object::AbstractTarget, REXML::Element) (defaults to: nil)

    Either the Xcode target to reference, or an existing XML 'MacroExpansion' node element or nil to create an empty MacroExpansion object



11
12
13
14
15
# File 'lib/xcodeproj/scheme/macro_expansion.rb', line 11

def initialize(target_or_node = nil)
  create_xml_element_with_fallback(target_or_node, 'MacroExpansion') do
    self.buildable_reference = BuildableReference.new(target_or_node) if target_or_node
  end
end

Instance Method Details

#buildable_referenceBuildableReference

Returns The BuildableReference this MacroExpansion refers to.

Returns:



20
21
22
# File 'lib/xcodeproj/scheme/macro_expansion.rb', line 20

def buildable_reference
  @buildable_reference ||= BuildableReference.new @xml_element.elements['BuildableReference']
end

#buildable_reference=(ref) ⇒ Object

Parameters:



27
28
29
30
31
# File 'lib/xcodeproj/scheme/macro_expansion.rb', line 27

def buildable_reference=(ref)
  @xml_element.delete_element('BuildableReference')
  @xml_element.add_element(ref.xml_element)
  @buildable_reference = ref
end