Class: Pod::SPM::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-spm/def/spm_dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {}, product: nil, pkg: nil)
  cmps = name.split("/")
  raise "Invalid dependency `#{name}`" if cmps.count > 2

  @name = cmps.first
  @product = product || cmps.last
  @options = options
  @pkg = pkg
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 4

def name
  @name
end

#pkgObject

Returns the value of attribute pkg.



5
6
7
# File 'lib/cocoapods-spm/def/spm_dependency.rb', line 5

def pkg
  @pkg
end

#productObject (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

#inspectObject 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