Class Feature::Repository::YamlRepository
In: lib/feature/repository/yaml_repository.rb
Parent: Object

YamlRepository for active and inactive features The yaml config file should look like this:

  features:
      an_active_feature: true
      an_inactive_feature: false

Example usage:

  repository = YamlRepository.new('/path/to/yaml/file')
  # use repository with Feature

A yaml config also can have this format:

  features:
    development:
      a_feature: true
    production:
      a_feature: false

This way you have to use:

  repository = YamlRepository.new('/path/to/yaml/file', '_your_environment_')
  # use repository with Feature

Methods

Public Class methods

Constructor

@param [String] yaml_file_name the yaml config filename @param [String] environment optional environment to use from config

Public Instance methods

Returns list of active features

@return [Array<Symbol>] list of active features

Checks for valid values in given feature hash

@param features [Hash] feature hash

[Validate]