Class: Pod::SPM::Resolver::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-spm/resolver/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Product

Returns a new instance of Product.



9
10
11
12
13
14
15
# File 'lib/cocoapods-spm/resolver/product.rb', line 9

def initialize(options = {})
  @pkg = options[:pkg]
  @name = options[:name]
  @linkage = options.fetch(:linkage, :static)
  @headers_path = options[:headers_path]
  @binary = options[:binary]
end

Instance Attribute Details

#binaryObject (readonly) Also known as: binary?

Returns the value of attribute binary.



5
6
7
# File 'lib/cocoapods-spm/resolver/product.rb', line 5

def binary
  @binary
end

#headers_pathObject (readonly)

Returns the value of attribute headers_path.



5
6
7
# File 'lib/cocoapods-spm/resolver/product.rb', line 5

def headers_path
  @headers_path
end

#linkageObject (readonly)

Returns the value of attribute linkage.



5
6
7
# File 'lib/cocoapods-spm/resolver/product.rb', line 5

def linkage
  @linkage
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/cocoapods-spm/resolver/product.rb', line 5

def name
  @name
end

#pkgObject (readonly)

Returns the value of attribute pkg.



5
6
7
# File 'lib/cocoapods-spm/resolver/product.rb', line 5

def pkg
  @pkg
end

Instance Method Details

#dynamic?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/cocoapods-spm/resolver/product.rb', line 21

def dynamic?
  @linkage == :dynamic
end

#inspectObject



17
18
19
# File 'lib/cocoapods-spm/resolver/product.rb', line 17

def inspect
  "#<#{self.class} #{pkg}/#{name}>"
end

#linked_as_framework?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/cocoapods-spm/resolver/product.rb', line 25

def linked_as_framework?
  dynamic? || binary?
end