Class: R10K::Feature::Collection
- Inherits:
-
Object
- Object
- R10K::Feature::Collection
- Defined in:
- lib/r10k/feature/collection.rb
Overview
Store all features and indicate if they’re available.
Instance Method Summary collapse
- #add(name, opts = {}, &block) ⇒ void
-
#available?(name) ⇒ true, false
Does a feature by this name exist and is it available?.
-
#initialize ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize ⇒ Collection
Returns a new instance of Collection.
5 6 7 |
# File 'lib/r10k/feature/collection.rb', line 5 def initialize @features = {} end |
Instance Method Details
#add(name, opts = {}, &block) ⇒ void
This method returns an undefined value.
13 14 15 |
# File 'lib/r10k/feature/collection.rb', line 13 def add(name, opts = {}, &block) @features[name] = R10K::Feature.new(name, opts, &block) end |
#available?(name) ⇒ true, false
Returns Does a feature by this name exist and is it available?.
18 19 20 21 22 |
# File 'lib/r10k/feature/collection.rb', line 18 def available?(name) if @features.key?(name) @features[name].available? end end |