Class: Pod::Installer::ProjectCache::TargetMetadata
- Inherits:
-
Object
- Object
- Pod::Installer::ProjectCache::TargetMetadata
- Defined in:
- lib/cocoapods/installer/project_cache/target_metadata.rb
Overview
Metadata used to reconstruct a PBXTargetDependency.
Instance Attribute Summary collapse
-
#container_project_path ⇒ String
readonly
The path of the container project the native target was installed into.
-
#native_target_uuid ⇒ String
readonly
The UUID of the native target installed.
-
#target_label ⇒ String
readonly
The label of the native target.
Class Method Summary collapse
-
.from_hash(hash) ⇒ TargetMetadata
Constructs a TargetMetadata instance from a hash.
-
.from_native_target(sandbox, native_target) ⇒ TargetMetadata
Constructs a TargetMetadata instance from a native target.
Instance Method Summary collapse
-
#initialize(target_label, native_target_uuid, container_project_path) ⇒ TargetMetadata
constructor
Initialize a new instance.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(target_label, native_target_uuid, container_project_path) ⇒ TargetMetadata
Initialize a new instance.
28 29 30 31 32 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 28 def initialize(target_label, native_target_uuid, container_project_path) @target_label = target_label @native_target_uuid = native_target_uuid @container_project_path = container_project_path end |
Instance Attribute Details
#container_project_path ⇒ String (readonly)
Returns The path of the container project the native target was installed into.
20 21 22 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 20 def container_project_path @container_project_path end |
#native_target_uuid ⇒ String (readonly)
Returns The UUID of the native target installed.
15 16 17 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 15 def native_target_uuid @native_target_uuid end |
#target_label ⇒ String (readonly)
Returns The label of the native target.
10 11 12 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 10 def target_label @target_label end |
Class Method Details
.from_hash(hash) ⇒ TargetMetadata
Constructs a TargetMetadata instance from a hash.
53 54 55 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 53 def self.from_hash(hash) TargetMetadata.new(hash['LABEL'], hash['UUID'], hash['PROJECT_PATH']) end |
.from_native_target(sandbox, native_target) ⇒ TargetMetadata
Constructs a TargetMetadata instance from a native target.
67 68 69 70 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 67 def self.from_native_target(sandbox, native_target) TargetMetadata.new(native_target.name, native_target.uuid, native_target.project.path.relative_path_from(sandbox.root).to_s) end |
Instance Method Details
#to_hash ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 34 def to_hash { 'LABEL' => target_label, 'UUID' => native_target_uuid, 'PROJECT_PATH' => container_project_path, } end |
#to_s ⇒ Object
42 43 44 |
# File 'lib/cocoapods/installer/project_cache/target_metadata.rb', line 42 def to_s "#{target_label} : #{native_target_uuid} : #{container_project_path}" end |