Class: Pod::SPM::Dependency
- Inherits:
-
Object
- Object
- Pod::SPM::Dependency
- Defined in:
- lib/cocoapods-spm/def/spm_dependency.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pkg ⇒ Object
Returns the value of attribute pkg.
-
#product ⇒ Object
readonly
Returns the value of attribute product.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
-
#initialize(name, options = {}, product: nil, pkg: nil) ⇒ Dependency
constructor
A new instance of Dependency.
- #inspect ⇒ Object
- #linkage ⇒ Object
Constructor Details
#initialize(name, options = {}, product: nil, pkg: nil) ⇒ Dependency
Returns a new instance of Dependency.
7 8 9 10 11 12 13 14 15 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 7 def initialize(name, = {}, product: nil, pkg: nil) cmps = name.split("/") raise "Invalid dependency `#{name}`" if cmps.count > 2 @name = cmps.first @product = product || cmps.last @options = @pkg = pkg end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 4 def name @name end |
#pkg ⇒ Object
Returns the value of attribute pkg.
5 6 7 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 5 def pkg @pkg end |
#product ⇒ Object (readonly)
Returns the value of attribute product.
4 5 6 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 4 def product @product end |
Instance Method Details
#dynamic? ⇒ Boolean
22 23 24 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 22 def dynamic? linkage == :dynamic end |
#inspect ⇒ Object
26 27 28 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 26 def inspect "#<#{self.class} name=#{name} product=#{product} pkg=#{pkg}>" end |
#linkage ⇒ Object
17 18 19 20 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 17 def linkage # TODO: How to detect the linkage of an SPM library? @pkg.linkage.is_a?(Hash) ? @pkg.linkage[@product] : @pkg.linkage end |