Class: R10K::Feature::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/r10k/feature/collection.rb

Overview

Store all features and indicate if they’re available.

Instance Method Summary collapse

Constructor Details

#initializeCollection



5
6
7
# File 'lib/r10k/feature/collection.rb', line 5

def initialize
  @features = {}
end

Instance Method Details

#add(name, opts = {}, &block) ⇒ void



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



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