Class: Pod::Installer::Analyzer::PodVariant
- Inherits:
 - 
      Object
      
        
- Object
 - Pod::Installer::Analyzer::PodVariant
 
 
- Defined in:
 - lib/cocoapods/installer/analyzer/pod_variant.rb
 
Overview
Bundles the information needed to setup a PodTarget.
Instance Attribute Summary collapse
- 
  
    
      #app_specs  ⇒ Array<Specification> 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The app specs for the target.
 - 
  
    
      #build_type  ⇒ BuildType 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The build type of the target.
 - 
  
    
      #platform  ⇒ Platform 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The platform.
 - 
  
    
      #specs  ⇒ Array<Specification> 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The spec and subspecs for the target.
 - 
  
    
      #swift_version  ⇒ String 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The Swift version of the target.
 - 
  
    
      #test_specs  ⇒ Array<Specification> 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    
The test specs for the target.
 
Instance Method Summary collapse
- 
  
    
      #==(other)  ⇒ Boolean 
    
    
      (also: #eql?)
    
  
  
  
  
  
  
  
  
  
    
Whether the PodVariant is equal to another taking all all their attributes into account.
 - 
  
    
      #initialize(specs, test_specs, app_specs, platform, build_type = BuildType.static_library, swift_version = nil)  ⇒ PodVariant 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
Initialize a new instance from its attributes.
 - 
  
    
      #root_spec  ⇒ Specification 
    
    
  
  
  
  
  
  
  
  
  
    
The root specification.
 - 
  
    
      #scoped_with_swift_version(swift_version)  ⇒ PodVariant 
    
    
  
  
  
  
  
  
  
  
  
    
A copy of this pod variant with the specified Swift version.
 
Constructor Details
#initialize(specs, test_specs, app_specs, platform, build_type = BuildType.static_library, swift_version = nil) ⇒ PodVariant
Initialize a new instance from its attributes.
      39 40 41 42 43 44 45 46 47 48  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 39 def initialize(specs, test_specs, app_specs, platform, build_type = BuildType.static_library, swift_version = nil) @specs = specs @test_specs = test_specs @app_specs = app_specs @platform = platform @build_type = build_type @swift_version = swift_version @hash = [specs, platform, build_type, swift_version].hash end  | 
  
Instance Attribute Details
#app_specs ⇒ Array<Specification> (readonly)
Returns the app specs for the target.
      16 17 18  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 16 def app_specs @app_specs end  | 
  
#build_type ⇒ BuildType (readonly)
Returns the build type of the target.
      24 25 26  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 24 def build_type @build_type end  | 
  
#platform ⇒ Platform (readonly)
Returns the platform.
      20 21 22  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 20 def platform @platform end  | 
  
#specs ⇒ Array<Specification> (readonly)
Returns the spec and subspecs for the target.
      8 9 10  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 8 def specs @specs end  | 
  
#swift_version ⇒ String (readonly)
Returns the Swift version of the target.
      28 29 30  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 28 def swift_version @swift_version end  | 
  
#test_specs ⇒ Array<Specification> (readonly)
Returns the test specs for the target.
      12 13 14  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 12 def test_specs @test_specs end  | 
  
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Non library specs are intentionally not included as part of the equality for pod variants since a pod variant should not be affected by the number of test nor app specs included.
Returns whether the Pod::Installer::Analyzer::PodVariant is equal to another taking all all their attributes into account.
      61 62 63 64 65 66 67  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 61 def ==(other) self.class == other.class && build_type == other.build_type && swift_version == other.swift_version && platform == other.platform && specs == other.specs end  | 
  
#root_spec ⇒ Specification
Returns the root specification.
      52 53 54  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 52 def root_spec specs.first.root end  | 
  
#scoped_with_swift_version(swift_version) ⇒ PodVariant
Returns A copy of this pod variant with the specified Swift version.
      81 82 83  | 
    
      # File 'lib/cocoapods/installer/analyzer/pod_variant.rb', line 81 def scoped_with_swift_version(swift_version) PodVariant.new(specs, test_specs, app_specs, platform, build_type, swift_version) end  |