Class: AptControl::ControlFile::Distribution
- Inherits:
-
Object
- Object
- AptControl::ControlFile::Distribution
- Defined in:
- lib/apt_control/control_file.rb
Overview
represents a set of rules mapped to a particular distribution, i.e. squeeze is a distribution
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#package_rules ⇒ Object
readonly
Returns the value of attribute package_rules.
Instance Method Summary collapse
-
#[](package_name) ⇒ Object
find a PackageRule by package name.
-
#initialize(name, rules) ⇒ Distribution
constructor
A new instance of Distribution.
Constructor Details
#initialize(name, rules) ⇒ Distribution
Returns a new instance of Distribution.
129 130 131 132 |
# File 'lib/apt_control/control_file.rb', line 129 def initialize(name, rules) @name = name @package_rules = rules end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
133 134 135 |
# File 'lib/apt_control/control_file.rb', line 133 def name @name end |
#package_rules ⇒ Object (readonly)
Returns the value of attribute package_rules.
134 135 136 |
# File 'lib/apt_control/control_file.rb', line 134 def package_rules @package_rules end |
Instance Method Details
#[](package_name) ⇒ Object
find a PackageRule by package name
137 138 139 |
# File 'lib/apt_control/control_file.rb', line 137 def [](package_name) package_rules.find {|rule| rule.package_name == package_name } end |