Sha256: b4b2c0792409ae465656064e6bbc2258fccb77a67f3ae4e560b4e07b3a026c70

Contents?: true

Size: 532 Bytes

Versions: 1

Compression:

Stored size: 532 Bytes

Contents

require 'flippeur/railtie' if defined?(Rails)
require 'flippeur/feature'
require "flippeur/version"

module Flippeur

  UnknownFeature = Class.new RuntimeError

  def self.setup(&block)
    reset
    module_eval &block
  end

  def self.feature(name, &block)
    features[name] = Feature.new(name, &block)
  end

  def self.find(name)
    features[name]
  end

  private

  def self.features
    @features ||= Hash.new { |_,k| raise UnknownFeature, "Unknown feature: #{k}" }
  end

  def self.reset
    @features = nil
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flippeur-1.0.0 lib/flippeur.rb