class R10K::Feature::Collection

Store all features and indicate if they're available.

Public Class Methods

new() click to toggle source
# File lib/r10k/feature/collection.rb, line 5
def initialize
  @features = {}
end

Public Instance Methods

add(name, opts = {}, &block) click to toggle source

@param name [Symbol] The feature to add @param opts [Hash] Additional options for the feature, see {R10K::Feature} @param block [Proc] An optional block to detect if this feature is present @return [void]

# File lib/r10k/feature/collection.rb, line 13
def add(name, opts = {}, &block)
  @features[name] = R10K::Feature.new(name, opts, &block)
end
available?(name) click to toggle source

@return [true, false] Does a feature by this name exist and is it available?

# File lib/r10k/feature/collection.rb, line 18
def available?(name)
  if @features.key?(name)
    @features[name].available?
  end
end