Class: Dependencies::Helpers::AptCachePolicy

Inherits:
Object
  • Object
show all
Defined in:
lib/dependencies/helpers/apt_cache_policy.rb

Constant Summary collapse

INSTALLED_VERSION_REGEX =
/  Installed: ([-+.a-z0-9]+)/.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ AptCachePolicy

Returns a new instance of AptCachePolicy.



10
11
12
# File 'lib/dependencies/helpers/apt_cache_policy.rb', line 10

def initialize(name)
	@name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/dependencies/helpers/apt_cache_policy.rb', line 8

def name
  @name
end

Instance Method Details

#installed?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/dependencies/helpers/apt_cache_policy.rb', line 18

def installed?
	!!installed_version
end

#installed_versionObject



14
15
16
# File 'lib/dependencies/helpers/apt_cache_policy.rb', line 14

def installed_version
	version_from_policy_version_line(installed_version_line)
end