Class: Xcodeproj::XCScheme::ExecutionAction
- Inherits:
-
XMLElementWrapper
- Object
- XMLElementWrapper
- Xcodeproj::XCScheme::ExecutionAction
- Defined in:
- lib/xcodeproj/scheme/execution_action.rb
Overview
This class wraps the ExecutionAction node of a .xcscheme XML file
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
- #action_content ⇒ ShellScriptActionContent, SendEmailActionContent
- #action_content=(value) ⇒ Object
-
#action_type ⇒ String
The ActionType of this ExecutionAction.
-
#initialize(node = nil, action_type = nil) ⇒ ExecutionAction
constructor
A new instance of ExecutionAction.
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(node = nil, action_type = nil) ⇒ ExecutionAction
Returns a new instance of ExecutionAction.
13 14 15 16 17 18 19 |
# File 'lib/xcodeproj/scheme/execution_action.rb', line 13 def initialize(node = nil, action_type = nil) create_xml_element_with_fallback(node, 'ExecutionAction') do type = action_type || node.action_type raise "[Xcodeproj] Invalid ActionType `#{type}`" unless Constants::EXECUTION_ACTION_TYPE.keys.include?(type) @xml_element.attributes['ActionType'] = Constants::EXECUTION_ACTION_TYPE[type] end end |
Instance Method Details
#action_content ⇒ ShellScriptActionContent, SendEmailActionContent
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/xcodeproj/scheme/execution_action.rb', line 39 def action_content case action_type when Constants::EXECUTION_ACTION_TYPE[:shell_script] ShellScriptActionContent.new(@xml_element.elements['ActionContent']) when Constants::EXECUTION_ACTION_TYPE[:send_email] SendEmailActionContent.new(@xml_element.elements['ActionContent']) else raise "[Xcodeproj] Invalid ActionType `#{action_type}`" end end |
#action_content=(value) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/xcodeproj/scheme/execution_action.rb', line 54 def action_content=(value) raise "[Xcodeproj] Invalid ActionContent `#{value.class}` for " \ "ActionType `#{action_type}`" unless valid_action_content?(value) @xml_element.delete_element('ActionContent') @xml_element.add_element(value.xml_element) end |
#action_type ⇒ String
Returns The ActionType of this ExecutionAction. One of two values:
Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction, Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.SendEmailAction.
27 28 29 |
# File 'lib/xcodeproj/scheme/execution_action.rb', line 27 def action_type @xml_element.attributes['ActionType'] end |