Class: Pod::Specification::Set::LazySpecification

Inherits:
BasicObject
Defined in:
lib/cocoapods/resolver/lazy_specification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, source) ⇒ LazySpecification

Returns a new instance of LazySpecification.



7
8
9
10
11
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 7

def initialize(name, version, source)
  @name = name
  @version = version
  @source = source
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



13
14
15
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 13

def method_missing(method, *args, &block)
  specification.send(method, *args, &block)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 5

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



5
6
7
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 5

def source
  @source
end

#versionObject (readonly)

Returns the value of attribute version.



5
6
7
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 5

def version
  @version
end

Instance Method Details

#specificationObject



25
26
27
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 25

def specification
  @specification ||= source.specification(name, version.version)
end

#subspec_by_name(name = nil, raise_if_missing = true) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/cocoapods/resolver/lazy_specification.rb', line 17

def subspec_by_name(name = nil, raise_if_missing = true)
  if !name || name == self.name
    self
  else
    specification.subspec_by_name(name, raise_if_missing)
  end
end