Method: Pod::Lockfile#version

Defined in:
lib/cocoapods-core/lockfile.rb

#version(pod_name) ⇒ Version, Nil

Returns the version of the given Pod.

Parameters:

  • pod_name (String)

    The name of the Pod (root name of the specification).

Returns:

  • (Version)

    The version of the pod.

  • (Nil)

    If there is no version stored for the given name.



86
87
88
89
90
91
92
93
# File 'lib/cocoapods-core/lockfile.rb', line 86

def version(pod_name)
  version = pod_versions[pod_name]
  return version if version
  root_name = pod_versions.keys.find do |name|
    Specification.root_name(name) == pod_name
  end
  pod_versions[root_name]
end