Class: Dependencies::Helpers::AptCachePolicy
- Inherits:
-
Object
- Object
- Dependencies::Helpers::AptCachePolicy
- Defined in:
- lib/dependencies/helpers/apt_cache_policy.rb
Constant Summary collapse
- INSTALLED_VERSION_REGEX =
/ Installed: ([-+.a-z0-9]+)/.freeze
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ AptCachePolicy
constructor
A new instance of AptCachePolicy.
- #installed? ⇒ Boolean
- #installed_version ⇒ Object
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
#name ⇒ Object (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
18 19 20 |
# File 'lib/dependencies/helpers/apt_cache_policy.rb', line 18 def installed? !!installed_version end |
#installed_version ⇒ Object
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 |