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
-
#initialize(name, options = {}, product: nil, pkg: nil) ⇒ Dependency
constructor
A new instance of Dependency.
- #inspect ⇒ Object (also: #to_s)
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
#inspect ⇒ Object Also known as: to_s
17 18 19 |
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 17 def inspect "#<#{self.class} #{name}/#{product} pkg=#{pkg}>" end |