Class: XcodeArchiveCache::BuildGraph::Graph

Inherits:
Object
  • Object
show all
Defined in:
lib/build_graph/graph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project) ⇒ Graph

Returns a new instance of Graph.

Parameters:

  • project (Xcodeproj::Project)


18
19
20
21
# File 'lib/build_graph/graph.rb', line 18

def initialize(project)
  @nodes = []
  @project = project
end

Instance Attribute Details

#dependent_build_settingsXcodeArchiveCache::BuildSettings::Container

Returns root target build settings.

Returns:



14
15
16
# File 'lib/build_graph/graph.rb', line 14

def dependent_build_settings
  @dependent_build_settings
end

#nodesArray<Node> (readonly)

Returns graph nodes.

Returns:

  • (Array<Node>)

    graph nodes



6
7
8
# File 'lib/build_graph/graph.rb', line 6

def nodes
  @nodes
end

#projectXcodeproj::Project (readonly)

Returns project.

Returns:

  • (Xcodeproj::Project)

    project



10
11
12
# File 'lib/build_graph/graph.rb', line 10

def project
  @project
end

Instance Method Details

#add_multiple_nodes(new_nodes) ⇒ Object



32
33
34
# File 'lib/build_graph/graph.rb', line 32

def add_multiple_nodes(new_nodes)
  @nodes += new_nodes
end

#node_by_name(name) ⇒ XcodeArchiveCache::BuildGraph::Node

Parameters:

  • name (String)

    Native target display name

Returns:



28
29
30
# File 'lib/build_graph/graph.rb', line 28

def node_by_name(name)
  nodes.select {|node| node.name == name}.first
end

#root_nodeXcodeArchiveCache::BuildGraph::Node



38
39
40
# File 'lib/build_graph/graph.rb', line 38

def root_node
  nodes.select {|node| node.is_root}.first
end

#to_sObject



42
43
44
# File 'lib/build_graph/graph.rb', line 42

def to_s
  nodes.map(&:to_s).join("\n")
end